creating two different primary menus

Hi
how can i create two different primary  menus each one to be used in to different group of pages?
thanks
Tagged:

Comments

  • Hi

    Yes,   You can create two different primary menu but you Can use  one group of primary menu at the same time . 

    To create primary menu refer this link 

    Thanks 
    Akhilesh
  • Hi 
    what i have in the header.php is 

    <?php wp_nav_menu( array(  
    'theme_location' => 'primary',
    'container'  => '',
    'menu_class' => 'nav navbar-nav navbar-right',
    'fallback_cb' => 'webriti_fallback_page_menu',
    'items_wrap'  => $social,
    'walker' => new webriti_nav_walker()
    ) );
    ?> 

    i changed it to 

    <?php
    if ( wp_emember_is_member_logged_in() ) {
        wp_nav_menu( array( 'menu' => 'logged-in-members', 'container'  => '',
    'menu_class' => 'nav navbar-nav navbar-right',
    'fallback_cb' => 'webriti_fallback_page_menu',
    'items_wrap'  => $social,
    'walker' => new webriti_nav_walker()
    ));
    else {
        wp_nav_menu( array( 'menu' => 'normal-visitor-menu', 'container'  => '',
    'menu_class' => 'nav navbar-nav navbar-right',
    'fallback_cb' => 'webriti_fallback_page_menu',
    'items_wrap'  => $social,
    'walker' => new webriti_nav_walker()
    ));
    }
    ?>

    i changed the menus names to "logged-in-members" and normal-visitor-menu

    what i'm getting as a result is only the logo is showing, no menu ,no body , no footer 

    please advice

    Thanks
  • hi 
    I found the solution 
     go to functions.php
    add this:
    <div><br></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;">function my_wp_nav_menu_args( $args = '' ) {</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;"><br></span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;">if( is_user_logged_in() ) {&nbsp;</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;"><span class="Apple-tab-span" style="white-space:pre"> </span>$args['menu'] = 'logged-in-members';</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;">} else {&nbsp;</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;"><span class="Apple-tab-span" style="white-space:pre"> </span>$args['menu'] = 'normal-visitor-menu';</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;">}&nbsp;</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;"><span class="Apple-tab-span" style="white-space:pre"> </span>return $args;</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;">}</span></font></div><div><font color="#464646"><span style="font-size: 14px; line-height: 28px;">add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );</span></font></div><div style="color: rgb(70, 70, 70); font-family: Arial, Verdana; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; line-height: 28px;"><br></div>
  • function my_wp_nav_menu_args( $args = '' ) {

    if( is_user_logged_in() ) { 
    $args['menu'] = 'logged-in-members';
    } else { 
    $args['menu'] = 'normal-visitor-menu';
    return $args;
    }
    add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

  • can you let me know if that ok with your appointment theme and it won't have any conflict...
    i did test i couldn't see any thing wrong
  • Hi 

    You want to create separate set of menus on separate pages.

    Thanks
    Priyanshu
  • hi 
    i added the following to functions.php
    and is working fine.  
     function my_wp_nav_menu_args( $args = '' ) {

    if( is_user_logged_in() ) { 
    $args['menu'] = 'logged-in-members';
    } else { 
    $args['menu'] = 'normal-visitor-menu';
    return $args;
    }
    add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

    only one thing please i want on the header of the "logged-in-members" pages only facebook as a  social links
    and the header of normal-visitor-menu' pages    only linkedin as a  social links

    thanks
    A
  • Hi

    Any luck!!!
  • Hi

    Any luck!!!
  • Hi

    Any luck!!!
Sign In or Register to comment.