Page Specific Header Menu/Primary Menu

  • Anonymous

    #10753

    I’m currently expanding my Web site at http://gwmo.com/gwmo to include both business and non/not-for-profit sections and need a different header/primary navigation bar for each section.

    After reading through the forum, I learned how to add and remove the secondary menu from specific pages, thank you Syahir and planning to use it in the future, but was not able to find anything about changing the header/primary menu on specific pages.

    Since it appears to be controlled by header-menu-wrap set in the Appearance > Menu Manage Locations, I’m not sure if a new page template would work. Perhaps something like the following in the functions file?

    < ?php

    if ( is_page_template('template1.php') ) {

    wp_nav_menu( array('menu' => 'Menu1' ));

    } else {

    wp_nav_menu( array('menu' => 'Menu2' ));

    }

    ?>

    *copied from CSS-TRICKS since I’m not a PHP expert.

    Anonymous

    #46694

    Hast du es schonmal so in der Art probiert? Glaube aber das entfernt sämtliche Header Menus:

    .menu {

    display:none;

    }

    .tinynav {

    display:none;

    }

Viewing 2 posts - 1 through 2 (of 2 total)

  • You must be logged in to reply to this topic.