- This topic has 3 replies, 2 voices, and was last updated 5 years, 1 month ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 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 › Hide post instead of showing "You do not have permission…" in index
Hello, i have try to search through the whole forum,
but seems i still cannot find a detailed answer for this question,
I have set up a website here:
nekodeveloper.com/dev/
where i have tried to use
$emember_auth = Emember_Auth::getInstance();
if($emember_auth->is_protected_post($post_id))
{
echo “don’t show”;
}else{
echo “show”;
}
in my index.php of the Twenty Sixteen theme to check whether the post show be show or not in the index page.
but the result is not correct.
please try to use “username: free, password: password” to login.
I wonder if anyone could give a kind help on this issue.
I will be pleased to share the login of this testing site.
Thank you!
chung
please check the post with title “Post for Login User only” after login, thx
or is there anyway that i can get the permission level of a post / page in the loop?
then may be i can use wp_emember_is_member_logged_in(‘1’) to do the trick…
thanks!
Maybe you want a solution like the following?
https://www.tipsandtricks-hq.com/wordpress-membership/auto-redirect-on-protected-pages-addon-1102
Also, the following page is a good read so you have an idea of the different options available in the plugin for content protection: