StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-02-2012, 09:28 AM
PKatSP PKatSP is offline
Registered User
Genesis Member
 
Join Date: Oct 2011
Posts: 14
Default Different Custom Menus (Logged in/Out)

This question has been asked on this forum before, but all the answers, including the one below, seem outdated and do not work. (Unless I've missed a topic)

The Question is this: How does one specify two different (custom) navigation menus for users that are logged in and users that are not, via the functions.php?

One obvious solution would seem to be as per the code (or similar) before, i.e. add_/remove_action, based on menu.php. However, this no longer seems to work with Genesis 1.8 and Wordpress 3.++. Any ideas please? It's a pretty basic yet essential thing that should be possible to do, right?

(And yes, I admit, my php knowledge is limited — but growing... :) )

PHP Code:
//Custom Menus
remove_action('genesis_after_header''genesis_do_nav');
add_action('genesis_after_header''custom_genesis_do_nav');
function 
custom_genesis_do_nav() {
        
    if ( 
is_user_logged_in() ) {
        
$nav wp_nav_menu(array(
            
'theme_location' => 'primary',
            
'menu' => 27,
            
'container' => '',
            
'menu_class' => genesis_get_option('nav_superfish') ? 'nav superfish' 'nav',
            
'echo' => 0
        
));
        
printf'<div id="nav"><div class="wrap">%s</div></div>'$nav );
    }
    else {
        
$nav wp_nav_menu(array(
            
'theme_location' => 'primary',
            
'menu' => 28,
            
'container' => '',
            
'menu_class' => genesis_get_option('nav_superfish') ? 'nav superfish' 'nav',
            
'echo' => 0
        
));
        
printf'<div id="nav"><div class="wrap">%s</div></div>'$nav );
    }
        

Any help would be much appreciated... Thank you in advance.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Links in Custom Menus - open in new window? SaraLepke General Discussion 3 07-27-2011 04:48 PM
Showing a video when you're logged in, an image when you're logged out GrantGannon General Discussion 3 04-09-2010 09:22 AM


All times are GMT -5. The time now is 02:52 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.