Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember – hide protected content title
Tagged: hide post, hide title, protection, wp membership
- This topic has 4 replies, 4 voices, and was last updated 12 years, 11 months ago by admin.
-
AuthorPosts
-
July 10, 2011 at 9:14 pm #3773foucault666Member
Hello,
I need to totally hide a protected post or category instead of showing his title with the “Your membership level does not allow you to view rest of content.”
It is possible and how?
Thank you very much
Michele
July 11, 2011 at 1:21 am #34156amin007ParticipantWP eMember does not hide the title of the posts or pages by default. It hides the main content (the post body) of the post or page. The membership plugin demo is a good way to see how the content protection works in eMember:
http://www.tipsandtricks-hq.com/eMember-demo/
Maybe you can try and use the “site wide protection” feature to see if that works for you. See the 3rd point from here:
You can also do some custom coding to apply condition in your theme so it doesn’t show the title of a post if the condition is not met. The title of an article is usually displayed using the following code in your theme:
<?php the_title(); ?>
You can put condition around this. WP eMember has functions that you can use to help with the condition wrapping. This documentation will explain the available functions in eMember that you can use when doing custom tweaking:
http://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248
July 11, 2011 at 2:20 pm #34157foucault666MemberThanks.
I passed a specific text variable through the_content() modifying emember_access_checkers.php, so if the_content() value is “access_denied” the template automatically hides the post.
Here sample code:
<?php
ob_start();
the_content();
$content = ob_get_clean();
if($content == 'access_denied') {
} else { ?>
// show the post
<?php } ?>December 28, 2011 at 8:00 pm #34158GerardMemberHello,
I am helping with building a store. The above looks like what i am looking for. We are gonna use it for selling photos but not everyone is allowed to buy everything. It are customers who did a photoshoot in the studio and they can look at there photo’s en buy prints etc.
What we want in short:
* we create a customer login en password
* when they enter the “store” page they only can see the basics
*when they log in their photoshoot pops up but not the photoshoot of others
What we have:
WP-eStore
WP-eMember
and we use the Nextgen Gallery plugin with the second option build in
Question: (because i am not a programmer but know my way around) where do i put this piece of code exactly?
Thanks for helping/answering
Gerard Brouwer
The Netherlands
[http://store.clickusvision.nl/] as a subdomain of [http://clickusvision.nl]
December 29, 2011 at 5:11 am #34159adminKeymasterI don’t see why you would need to custom code it. From your explanation I think all you need is just section protection feature of eMember:
https://www.tipsandtricks-hq.com/wordpress-membership/how-to-protect-a-section-of-a-post-or-page-88
-
AuthorPosts
- You must be logged in to reply to this topic.