1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

different menus in my wordpress

Discussion in 'HTML & Website Design' started by blogreview, Nov 26, 2012.

  1. #1
    hi,everybody,i need to implement different menus in my Response wordpress site.if the user didn't login to our site i need to display one menu,and when he login to our site i need to show another menu.can it possible here ?.if so, please suggest me
    SEMrush
     
    blogreview, Nov 26, 2012 IP
    SEMrush
  2. Philvault

    Philvault Active Member

    Messages:
    1,284
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Philvault, Nov 26, 2012 IP
  3. bowodesign

    bowodesign Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    if you want to use custom code you can try this

    dashboard > Appearance > Menu

    create 2 different menu

    1. register-user (menu that will appear for registered user)
    2. unregister-user (menu that will appear for unregistered user)

    note: u must have custom menu function on your theme

    now open your theme using notepad++ or something else and find something that similar like this

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    
    
    
    Code (markup):
    and than change to something like this one

    <?php
    
    if( is_user_logged_in() ) {
        $menu = 'register-user';
    
    } else {
        $menu = 'unregister-user';
    
    }
     
    wp_nav_menu( array( 'menu' => $menu, 'container_class' => 'menu-header', 'theme_location' => 'primary' ) );
    ?>
    
    
    
    Code (markup):
    that code will detect if user login, the menu that will use is menu from register-user and if not it will use menu from unregister-user

    hope this can help :)
     
    bowodesign, Nov 26, 2012 IP
  4. blogreview

    blogreview Member

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Hi , guys.
    I appreciate all of you.
    It works.
    Thank you for help many, many times!!!
     
    blogreview, Nov 27, 2012 IP
  5. lwilliams777

    lwilliams777 Member

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #5
    Whenever I attempt to create a new menu through dashboard>appearance>menu I receive an error "You do not have sufficient permissions to access this page.". I checked the file permissions and they are 755. Might you have some suggestions as to how to deal with that? Thanks.
     
    lwilliams777, Nov 27, 2012 IP