From d26b63671a0284facec09485bf9bab5aae3e9faa Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 16 Dec 2016 09:00:15 -0500 Subject: [PATCH] checking to see if the page has an excerpt before trying to access it to prevent getting the page content instead --- sections/top-bar.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sections/top-bar.php b/sections/top-bar.php index a929638..4ca2206 100644 --- a/sections/top-bar.php +++ b/sections/top-bar.php @@ -34,7 +34,12 @@ foreach($post_data as $pd=>$value){ $image = false; } $image = wp_get_attachment_image_src( get_post_thumbnail_id( $value->ID ), array(300,250) ); - $dropdown[$value->ID]['excerpt'] = get_the_excerpt($value->ID); + if (has_excerpt($value->ID) ){ + $dropdown[$value->ID]['excerpt'] = get_the_excerpt($value->ID); + } else { + $dropdown[$value->ID]['excerpt'] = " "; + } + $dropdown[$value->ID]['menu'] = $pd; } -- 2.17.1