473,473 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

2 Different Menus

1 New Member
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:

Expand|Select|Wrap|Line Numbers
  1. if (function_exists('wp_nav_menu')) {
  2.                         if(is_user_logged_in())
  3.                                       $primaryNav = wp_nav_menu( array( 'theme_location' => 'logged-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) ); 
  4.     } else {
  5. $primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) ); 
  6.                     };
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!
Aug 11 '11 #1
1 1921
Death Slaught
1,137 Top Contributor
This isn't an HTML or CSS question. Please ask in the PHP section.

Regards
Death
Aug 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dan Greenblatt | last post by:
I know this can be done for context menus with the 'post' command.... What I'm trying to do, though, is programmatically post non-contextual menus (i.e. menus that exist on a horizontal menu bar...
7
by: Jason Webb | last post by:
Dear Microsoft, The current "Windows.Forms" controls included in the .Net Framework are good, but in many ways they're pretty basic, and I think it's time that you take Windows.Forms to the...
19
by: chart43 | last post by:
I have question about the technique for css dropdown menus described in http://www.alistapart.com/articles/horizdropdowns/. Based on an html list, it has a few items in a 1st order list and further...
32
by: Continental Translations | last post by:
Can anybody help me? I am trying to create two drop down menus, where the results of the second one vary depending on what was selected in the first one. I am using MS Script Editor in MS Front...
4
by: Larry R Harrison Jr | last post by:
I have them working now, courtesy of the link given in the prior thread--the HVMenu over at Dynamic Drive myself. http://www.dynamicdrive.com I have them working as side-bar menus, not...
4
by: ssg31415926 | last post by:
I've got a ListView which can show many different types of object. I need to display a ContextMenu whose MenuItems depend on the object type. I was planning to pre-create the ContextMenus when...
6
by: Juan Romero | last post by:
Hey guys, Is it possible in VB.NET to do owner drawn menus? I want to spice up my menus a bit with graphics and colors. Can this be done? If so, please point out some tutorials on this matter. ...
2
by: Ron M. Newman | last post by:
Hi, Just need a little advice. Id like to build *dynamic* context menus for tree nodes. I'm pretty versed in building context menus and attaching them to tree nodes. My question is, what...
2
by: diogenes | last post by:
I have created many shortcut/popup (aka context, or right-click) menus for my application - instead of toolbars or standard drop-down menus. Within my custom menu, I am using...
6
by: dbuchanan | last post by:
There are three parts to this 1.) How do I cascade menus? 2.) And, how do I cascade menus with a multi-select CheckBoxList?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.