Adding subtitles to a custom menu in Twenty Ten child theme
-
I’m trying to add sub-titles (based on a custom field set on each page) to my menu items using the method for wp_page_menu described here: https://themeshaper.com/wordpress-menu-tricks/
BUT I’m trying to adapt it for a custom menu!Test site is here: https://leahbloom.dreamhosters.com/
I’ve added the following code (appended at end of post) to a functions.php file in my child theme- the thing is, it adds subtitles when the last line of code is: “add_filter(‘wp_page_menu’,’childtheme_page_menu’);”
… but that displays all pages, not my primary custom menu. If I change it to:
“add_filter(‘wp_nav_menu’,’childtheme_page_menu’);”
…then it displays the custom menu correctly but the subtitles go away. This must be because of the custom menu code in the Twenty Ten header:
<?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>Any way to combine these two?
*************
child theme functions.php is:[Code moderated as per the Forum Rules. Please use the pastebin]
- The topic ‘Adding subtitles to a custom menu in Twenty Ten child theme’ is closed to new replies.