• kvdj

    (@kristof-van-der-jonckheyd)


    Hi,

    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.

    ex:

    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’ ) ); ?>
    </div>
    <?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 ??

    Thanks!

    Kristof

Viewing 2 replies - 1 through 2 (of 2 total)
  • Tanaji

    (@tanajibhanvasegmailcom)

    Hi,
    I want display menu on small image, there are two images I want to display alternate images and menu on them. How to display?. I am try change the function wp_nav_menu() before and after attributes in the wordpress file (nav_menu_template.php) but it is display single image and that is repeated to all menu. I need help please give me solution.

    @tanaji Bhanvase

    please start your own topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘dynamic submenu bar under main menu bar’ is closed to new replies.