WordPress.org

Ready to get started?Download WordPress

Forums

dynamic submenu bar under main menu bar (3 posts)

  1. Kristof Van der Jonckheyd
    Member
    Posted 2 years ago #

    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

  2. Tanaji
    Member
    Posted 2 years ago #

    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.

  3. @Tanaji Bhanvase

    please start your own topic.

Topic Closed

This topic has been closed to new replies.

About this Topic