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

Hiding content from registered users but not general public?

by

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, 10 months ago by admin.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • April 22, 2011 at 3:48 pm #3234
    cflyrun
    Member

    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 #31656
    amin007
    Participant

    I 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 #31657
    cflyrun
    Member

    Yes, 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 #31658
    cflyrun
    Member

    Is 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 #31659
    amin007
    Participant

    The 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 #31660
    verity
    Member

    I 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

    Please login or join.

    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 #31661
    amin007
    Participant

    Please 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 #31662
    verity
    Member

    I 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 #31663
    amin007
    Participant

    Change 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 #31664
    verity
    Member

    It worked. Thanks!

    May 21, 2011 at 3:45 pm #31665
    verity
    Member

    When 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 #31666
    amin007
    Participant

    https://support.tipsandtricks-hq.com/forums/topic/how-to-customize-various-textmessages-displayed-by-the-plugin

    August 30, 2011 at 7:40 pm #31667
    cflyrun
    Member

    Back 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 #31668
    admin
    Keymaster

    You 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

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 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