From: Anthony Talarico Date: Thu, 25 Jan 2018 21:36:39 +0000 (-0500) Subject: adding dropdown menu text X-Git-Tag: v1.0.0^2~98 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=6a0ffcd69bbc80bcf38c7d5edc5081a656edcd8f;p=WP-Themes%2Fwmta.git adding dropdown menu text adding excerpt display for the dropdown menus --- diff --git a/functions.php b/functions.php index 931a500..9220d7d 100644 --- a/functions.php +++ b/functions.php @@ -42,7 +42,7 @@ function wmta_setup() { * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); - + add_post_type_support('page','excerpt'); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary Navigation', 'wmta' ), diff --git a/inc/menu-walker.php b/inc/menu-walker.php index 21e8081..240902b 100644 --- a/inc/menu-walker.php +++ b/inc/menu-walker.php @@ -45,12 +45,27 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu { position: absolute; left: 15px; top: 15px; - } "; + } else { $item_style .= ""; } + $excerpt = has_excerpt($object->object_id); + if($depth == 0 && $excerpt){ + $the_excerpt = get_the_excerpt($object->object_id); + $item_style .= ""; + } //$output .= ( 0 == $depth ) ? '
  • ' : ''; $classes = empty( $object->classes ) ? array() : (array) $object->classes; if ( in_array( 'label', $classes ) ) {