I have a wordpress blogsite that I have been working on and I have one question that I am needing help with. I am looking to have 2 menus, 1 for when a visitor is there and 1 for when a user is logged in. I have everything setup accordingly and I have referenced an extra menu in function.php. I am needing to edit the code under the header.php to get it to work. Currently the menu works when the user is logged in, but the menu that appears when nobody is logged in does not pull from the menu I created. It just displays every page on my site.
Here is the code under header.php that I currently have:
I just need to fix this so that it works and references the menu I have for users that are not logged in. Thanks in advance!
Here is the code under header.php that I currently have:
Code:
if (function_exists('wp_nav_menu')) { if(is_user_logged_in()) $primaryNav = wp_nav_menu( array( 'theme_location' => 'logged-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) ); } else { $primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) ); };
Comment