From 6a0ffcd69bbc80bcf38c7d5edc5081a656edcd8f Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 25 Jan 2018 16:36:39 -0500 Subject: [PATCH] adding dropdown menu text adding excerpt display for the dropdown menus --- functions.php | 2 +- inc/menu-walker.php | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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 ) ) { -- 2.17.1