I'm trying to set up customized submenu bars under my main menu items. The submenu bar holds the childs of the parent main menu item you're curretly at.
Nutrition| Excersice | About | Contact
Diets | Recepies | Supplements
So I would like to show the submenu items depending on the parent where you're at. In the examples case, the nutrition category.
For this I tried to add a simple line of php in the .header.php file:
<?php if (is_page('Nutrition')): ?>
<div id="access2" role="navigation">
<?php wp_nav_menu( array( 'container_class' => 'menu-header2', 'theme_location' => 'secondary' ) ); ?>
<?php endif; ?>
But it's not working. I can however choose and make a secondary navigation in my wordpress dashboard > appearance > Menus. But the problem is that it isn't showing on my website when I'm in the nutrition category. (It's actually showing never..)
I've checked the HTML, and it's not there. So I guess there must be something wrong or missing in my php...?
I'm completely new to php and have little knowledge of it. So go easy on me :-)