- This topic has 2 replies, 3 voices, and was last updated 12 years, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › How to block post titles in a category
Tagged: block category content, post titles
I’ve been working on setting up the WP eMember plugin and am now not sure if I bought the right one. After reading reams of tips and posts and answers, I have not found the right way to block out all posts in a category, INCLUDING POST TITLES, until a user is logged in. My main menu will show two categories. One is open, the other protected. Community History is public, Community Members is not.
Those post titles should be blocked in all instances, including an archive page, only the category title should show, and when clicked there should be a prompt to join, or log in and nothing else on the page (such as an empty comments form container). I know this has been discussed, but I couldn’t make out the solution from the discussions. I am not a coder, that’s why I bought the plugin. Am using Thesis so can create custom functions.
The site is very much a work in progress: http://www.devtests.com/. Am testing the best way to use the eMember plugin at present and getting very frustrated. Can you help?
Hi,
The following post may help:
https://support.tipsandtricks-hq.com/forums/topic/hide-protected-content
As an example here’s a modification I did as a test for the “Twenty Eleven” theme.
This an example for when a post is displayed on a single page – ie, I edited the content-single.php file:
The original line of code was as follows:
<h1 class="entry-title"><?php the_title(); ?>
To suppress the heading, I modified it as follows:
<h1 class="entry-title"><?php if(wp_emember_is_member_logged_in()) the_title(); ?>
The above is a simple example which will suppress the post heading if someone is not logged in. You may also want to add a message in an “else” branch if you desire.
Note: You will need to do something similar for other instances where the post heading is displayed too such as in pages, or post excerpts etc.
Another option is to use site-wide protection
Hope this helps.
I wanted to hide the page titles in my child of twenty eleven theme and this worked great. Titles are in content-page.php and content-single.php