latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Hidding Content From Logged in Uers

Home Forums Community Forum Hidding Content From Logged in Uers

This topic contains 5 replies, has 3 voices. Last updated by  cassel 4 years, 2 months ago.

Topic Author Topic
Posted: Wednesday Nov 7th, 2012 at 10:45 am #30902

Hi All,

Here’s a question… I want to hide content on the home page from users who are Logged In.

The content is only required for non registered users and i want to hide it from users who are logging in so they dont get the sales message every time.

Any ideas?

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Wednesday Nov 7th, 2012 at 10:51 am #30903
cassel
Username: cassel

Yes, you can use the conditional in shortcode format:

[s2If !is_user_logged_in()]
Some public content for anyone NOT logged in.
A leading !exclamation means false.
[/s2If]

and if you want to display something only to logged in members, you can use this:
[s2If is_user_logged_in()]
Content for anyone that is logged in, regardless of their Membership Level.
[/s2If]

You can get more information on conditionals in s2Member > API / Scripting > Simple Shortcode/Conditional.

Posted: Wednesday Nov 7th, 2012 at 12:17 pm #30919

Cassel – you are a star! – thank you, thank you, thank you :-)

Posted: Thursday Nov 8th, 2012 at 7:54 am #31011

Yes, she is. :)

Posted: Thursday Nov 8th, 2012 at 10:01 am #31034

Guys, can i add an additional question to this solution…?

I have a page visible to non registered customers and is part of the menu here:

http://networkmarketingsystem.mikelowndes.com/membership-options-page/

I would like to hide this page from members who are logged in at any level from 1-3 (Paying customers) as these will get the option to buy the upgrade if available. As the the Membership options page should only be available to those who NEED to buy in to the site.

Can i Hide this page from none member and level 0 members?

Thanks in advance
Mike

Posted: Thursday Nov 8th, 2012 at 1:30 pm #31048
cassel
Username: cassel

You can use the exact same principle but with a conditional based on the levels instead of the logging. Something like this:

[s2If current_user_can(access_s2member_level1)]
   Some content for Members who are logged in with an s2Member Level 1 (you dont have to specify Level 2 and Level 3 since those will automatically have access to Level 1.
[/s2If]


[s2If !current_user_can(access_s2member_level1)]
   Here you can put the membership options that will only be displayed to those who do NOT have access to the level 1, whether they are logged in or not.
[/s2If] 

All in all, you can have a whole page displayed to members who are already registered at the first paid level and a whole different page displayed to members who are not registered. Using those conditionals is sooooooo flexible.

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.