Jump to content


Photo

How to create a conditional menu?


This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 ddmunoz

ddmunoz

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 04 November 2010 - 04:18 AM

I am currently using WP-eMembers which is a plug-in for managing accounts, and I need to place a page that appears on the main menu, only after the users access the premium account. In other words, I am trying to add a condition around the main menu so a page only gets displayed on the main menu when the condition meets. Where is the code block that displays the menu on platform pro ? Could you please explain to me step-by-step because I am learning right now? This is a copy of the code that I have to paste on the theme. global $auth; $user_id = $auth->getUserInfo('member_id'); if (!empty($user_id)) { //pleace code that only members can see } Thank you very much! David

#2 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 04 November 2010 - 04:28 PM

I'm not actually not quite sure if this is possible to build in to the WP3.0 menu system. Possibly into the default wp_list_pages function, which are you using? I might also consider CSS by adding a class to the body if logged in? then use it to hide/show nav item

#3 ddmunoz

ddmunoz

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 04 November 2010 - 07:29 PM

Hello Adam, Thank you very much for answering my question. I asked a developer of WP-eMembers to create this conditional menu for me, but he needs to know, where is the code block that displays the menu on platform pro? Thank you again for taking the time to answer my question!

#4 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 04 November 2010 - 11:42 PM

the file is in this directory SECTIONS > NAV > section.nav.php