Tips and Tricks HQ Support Portal › Forums › WP eMember › Create menu item that only shows certain content based on membership level?
Tagged: eMember, member only menu, menu
- This topic has 11 replies, 6 voices, and was last updated 8 years, 4 months ago by wzp.
-
AuthorPosts
-
August 19, 2012 at 2:06 am #7188stephen299Member
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 #48494adminKeymasterAugust 20, 2012 at 2:13 am #48495stephen299MemberWell, 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 #48496adminKeymasterYes, 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:
http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248
August 21, 2012 at 12:48 am #48497stephen299MemberThat’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 #48498adminKeymasterNo, 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 #48499wjdilworMemberHas 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 #48500jerrycMemberTry 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 #48501jerrycMemberI 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 #48502wjdilworMemberThanks! I’ll give that a try.
June 13, 2016 at 5:27 pm #48503mytricksandtipsMemberHello,
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 C
June 13, 2016 at 7:51 pm #48504wzpModerator -
AuthorPosts
- You must be logged in to reply to this topic.