Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Hide post instead of showing "You do not have permission…" in index

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › Hide post instead of showing "You do not have permission…" in index

  • This topic has 3 replies, 2 voices, and was last updated 5 years, 7 months ago by admin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 2, 2019 at 10:18 am #15397
    chung
    Member

    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

    December 2, 2019 at 10:26 am #80146
    chung
    Member

    please check the post with title “Post for Login User only” after login, thx

    December 2, 2019 at 12:15 pm #80147
    chung
    Member

    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!

    December 3, 2019 at 12:47 am #80148
    admin
    Keymaster

    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:

    https://www.tipsandtricks-hq.com/wordpress-membership/overview-of-the-available-content-protection-methods-532

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ