August 19, 2012 at 2:06 am #7188
I want to create a new menu item that would only show the content available to a user based on their membership level. For example, if they are a member for a Math class, I would want that menu item to say “My Classes” then a dropdown menu showing what classes they are a member of. In this case, the drop down menu would only have one item, “Math,” which would then link to that category.
Is there anyway to do this? Thanks!August 19, 2012 at 6:22 am #48494August 20, 2012 at 2:13 am #48495
Well, I have done that and it works great, but I would like to show different menu items to people with different membership levels. Is there anyway to do that?August 20, 2012 at 11:10 pm #48496
Yes, you can extend step 6 from the above mentioned tutorial and add more condition there so different membership levels can see different navigation menu. The following documentation has example snippet code that will show you how to retrieve the membership level of a logged in member. This should help you extend that code:August 21, 2012 at 12:48 am #48497
That’s perfect! I just have one more question and that is can I put multiple membership levels in the condition? So say I want membership levels 1 and 2 to see the same menu, would I just put ( if ( wp_emember_is_member_logged_in (‘1,2’) )? Thanks!August 21, 2012 at 11:22 pm #48498
No, that function doesn’t take multiple levels yet. You can separate it and make two conditions form them.January 12, 2013 at 1:51 pm #48499wjdilworMember
Has this feature been added to the function yet? If not, is there a plan to include this? I am having the same problem.
Thank you.January 13, 2013 at 12:46 am #48500jerrycMember
Try this concept:
( ( if ( wp_emember_is_member_logged_in (‘1’) ) || ( if ( wp_emember_is_member_logged_in (‘2’) ) )
It should do the exact same thing and should work right now, with no feature upgrade.January 13, 2013 at 2:01 pm #48501jerrycMember
I think this might be better bracketing:
if ( ( wp_emember_is_member_logged_in (‘1’) ) || ( wp_emember_is_member_logged_in (‘2’) ) )
The concept is that it will return true if either condition exists.January 14, 2013 at 1:32 am #48502wjdilworMember
Thanks! I’ll give that a try.June 13, 2016 at 5:27 pm #48503mytricksandtipsMember
I am attempting to have logged in members see a different menu than non-logged in visitors. I am using OptimizePress, which also allows for creation of membership. However I am using eMember for my membership levels, and not OptimizePress.
I am unable to get the ‘logged in’ menu to show. I see two problems:
1) Although I checked in emember settings as related to WP to show people logged in to WP when they log in to eMember, I cannot get the logged in menu to show. I believe the problem is the theme is looking for the OptimizePress Membership, which I am no using.
2) OptimizePress as you are aware changes the WP coding around bigtime, and I have not been able to find where to edit any of the coding to include the code you are providing in tje different tipsandtricks articles I found. I want to show Support on the menu when people are logged in, but not when they are not. You help with a solution will be greatly appreciated! Thanks.
A CJune 13, 2016 at 7:51 pm #48504wzpModerator
- You must be logged in to reply to this topic.