Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › Hiding content from registered users but not general public?
- This topic has 13 replies, 4 voices, and was last updated 13 years, 2 months ago by admin.
-
AuthorPosts
-
April 22, 2011 at 3:48 pm #3234cflyrunMember
I have a page where I have successfully hidden protected content from all but those who have the proper membership level. Above the hidden content is teaser content, and below the hidden content is a link to purchase the hidden content.
My question is this – once the user purchases the content, they can then see the entire page, including the content at the bottom where the link to purchase the content they’ve already purchased is viewable.
Now, I’m sure it won’t confuse anybody or anything, but I’m just curious, is there a way to hide that content at the bottom, so that once the user has purchased the content, and can view the protected content, the content at the bottom that *was* public is now protected from them, since they already have access and don’t need to purchase again? My guess is that I need to protect *that* content with a shortcode, and set it so it’s viewable by all BUT that particular product item’s associated member level ID?
It’s not that big of a deal, just looking to keep things cleaned up for the user.
Thanks in advance, hope that’s a simple one to answer
Daisy
April 23, 2011 at 12:22 am #31656amin007ParticipantI was in the process of adding in a shortcode like the following that you can use to wrap a section of a post or page which is only viewable by users who are NOT logged in. So as soon as someone logs in (a member) and view the page *that* section of the post or page will not be viewable to them.
Here is an example use:
[emember_protected scope=not_logged_in_users_only]
Only anonymous users can see this section of the content. Logged in members will not see this content.
[/emember_protected]Let me know if this will help.
April 23, 2011 at 3:02 am #31657cflyrunMemberYes, that’s exactly it, but it’d have to be able to be set so that logged in members with specific member id could still see it (basically exclude only those members who already have access to the protected content).
Daisy
April 28, 2011 at 4:15 pm #31658cflyrunMemberIs the above shortcode something I can use currently or is it a feature in a future build? Just curious.
Thanks,
Daisy
April 29, 2011 at 4:16 am #31659amin007ParticipantThe above mentioned shortcode was added to the plugin in the last build. So you should be able to use it as long as you get a build with this shortcode implementation in it.
May 20, 2011 at 4:20 pm #31660verityMemberI want to be able to have links within the hidden content message. For example if my hidden content message says “Please login or join, ” I want it to display as
I tried adding html code to the eng.php file, but it gave me a syntax error. Is it possible to have links in this message?
May 21, 2011 at 12:01 am #31661amin007ParticipantPlease post the language file modification that you did (I should be able to see the error you made and correct you).
May 21, 2011 at 3:20 am #31662verityMemberI edited line 5 of eng.php
define("EMEMBER_HIDDEN_CONTENT_MESSAGE","Please <a href="http://mywebsite.com/login">login</a> or <a href="http://mywebsite.com/membership-payment">join.");
And here is the error I got:
Parse error: syntax error, unexpected T_STRING in /home/content/15/6853715/html/wp-content/plugins/wp-eMember/lang/eng.php on line 5
The site won’t even load with that code edited, so I put the code back to what it was, without any html in it.
May 21, 2011 at 5:01 am #31663amin007ParticipantChange line 5 to the following:
define("EMEMBER_HIDDEN_CONTENT_MESSAGE",'Please <a href="http://mywebsite.com/login">login</a> or <a href="http://mywebsite.com/membership-payment">join</a>.');
You either need to escape the double quotes or use single quote outside. also After the work “join” you didn’t finish the
<a>
tag.May 21, 2011 at 3:33 pm #31664verityMemberIt worked. Thanks!
May 21, 2011 at 3:45 pm #31665verityMemberWhen a free member is logged in, they don’t have access to the paid content. I want to remove the line that says “Please Renew your account.” How do I remove this text, but keep the text that says “Please login or join.”?
May 21, 2011 at 11:51 pm #31666amin007ParticipantAugust 30, 2011 at 7:40 pm #31667cflyrunMemberBack to the original topic of the thread – is it possible to put that shortcode as a php line in a template file in my theme?
Thanks
August 31, 2011 at 1:51 am #31668adminKeymasterYou can use PHP code in your template file so there is no need to use that shortcode. Simply use one of the functions to determine if a user is logged in or not… some examples here:
http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248
-
AuthorPosts
- You must be logged in to reply to this topic.