Menu Descrips
URL to the page in question:
-
Brian,
From what I’ve read and attempted myself, it seems adding this is not as simple as one thinks it should be. Why it is not a default setting, who knows. If this is too much work and would be better fit for an update, I understand. Maybe it is where I’m putting this “walker” code, I’m not sure either. Or even if you can point me to a helpful link. Thanks.
Jeff,
I can honestly say I’ve never had a site or theme that used the navigation menu descriptions. But they are there to be used if you’re in a situation where they would be helpful. Sayed has a nice article at http://www.wpbeginner.com/wp-themes/how-to-add-menu-descriptions-in-your-wordpress-themes/ that might be a good place to start.
You’d want to add the walker class to the bottom of the functions.php file. Then in the header.php file you’d want to edit this line:
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => 'nav' ) ); ?>
so that it looks something like this:
<?php $walker = new Menu_With_Description; ?>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => 'nav', 'walker' => $walker ) ); ?>
See how that works. You’ll still have to add in styling to make it display properly and look good too.
Hope that helps,
Bill
It worked… kinda. Similar to what I was seeing before, but on the left versus being right above where the normal navigation buttons were.
You can most likely position them on either side via CSS. There won’t be anything built into the theme to support this so you’ll have to write what’s necessary in order to have them display in the right spot.
No problem Jeff. Have a great day.
- The topic ‘Menu Descrips’ is closed to new replies.