Tips and Tricks HQ Support Portal › Forums › WP eMember › Conditional content by member level
Tagged: conditional content, eMember, protected post
- This topic has 5 replies, 2 voices, and was last updated 13 years, 9 months ago by amin007.
-
AuthorPosts
-
January 27, 2011 at 6:32 am #2585Mike wellingMember
Hi I’ve look at the protect section by member level
from what I can tell i can only setup up:
if membership level = silver then display content x
else – display error message
I would like to answer the particular issue:
if membership level = silver then display content x
if membership level = gold then display content y
if membership level = platinum then display content z
etc…
Could you please let me know shortcode or php function to allow me to do so
Thanks
Mike
January 28, 2011 at 3:25 am #28435amin007ParticipantWe cannot design a shortcode where there can be a large number of inputs. We need to have defined inputs. In your case if someone has setup 50 Membership levels the shortcode will have to take 50 inputs which is not ideal.
This is what you can do. Use the section protection and list the content of each membership level like the following:
Content for Membership Level X
[emember_protected for=1]
Content form level x goes here
[/emember_protected]
Content for Membership Level Y
[emember_protected for=2]
Content form level y goes here
[/emember_protected]
Content for Membership Level Z
[emember_protected for=3]
Content form level z goes here
[/emember_protected]
etc…
Now a member will only be able to view the section for his/her membership level.
January 30, 2011 at 10:55 pm #28436Mike wellingMember@amin007 – thanks for the tip it worked great. Only thing I need to figure out now is to hide the protected content message so it would display only the content for each member level and not the content for current member level & error message for each section. Any tips would be appreciated.
January 31, 2011 at 5:42 am #28437amin007ParticipantYou can find that line in the language file and customize it so it read better. This post will explain what to do:
February 1, 2011 at 1:41 am #28438Mike wellingMemberThanks for the article.
I changed the language file to be ‘blank’ for this particular case.
However, what I’m seeing is 2 breaks included above the content per member level.
So if I have 8 member levels (currently) & happen to be member level 8 then the section gets pushed down 16 lines from the top.
Is there a way to not display an error message rather than change language that is displayed.
Thanks
Mike
February 1, 2011 at 4:41 am #28439amin007ParticipantOpen “wp_eMember1.php” file and search for the followoing:
$replacement = '<a '. $join_url .' ><b>'.EMEMBER_MEMBERS_ONLY_MESSAGE.'</b></a>';
Once you find it change it to the following:
$replacement = '';
That might do the trick.
-
AuthorPosts
- You must be logged in to reply to this topic.