Page 1 of 1

How to hide content from users on template pages

PostPosted: January 25th, 2012, 5:06 am
by hazardous_waster
Hello all!

I'm looking at using S2 member on another one of my projects and have used it in the past and its been great but I need to use it for something a bit different this time and I'm not sure it has the functionality.

So I can hide and display content depending if you’re logged in or not as such on any page or on any post

[s2If is_user_logged_in()]
This displays if user is loged in
[/s2If]

[s2If is_user_not_logged_in()]
This displays if user is NOT loged in
[/s2If]

But what I need to do is hide actual elements and functionality in a Wordpress template ... so basically what I need to do is something like that as a PHP expression, make sense, is that possible?

Regards Neil Kelsey

Re: How to hide content from users on template pages

PostPosted: January 25th, 2012, 10:28 am
by Eduan
So you mean hide a special feature of the theme for example, depending on the level?

Re: How to hide content from users on template pages

PostPosted: January 25th, 2012, 11:34 am
by hazardous_waster
exactly that, so say there is a special PDF you can only download if your a certain user, I want to be able to hide that if your not the correct level and need to do so in the actual page template itself.

Its a bit more complicated then that (its basically a widget of PDF's that I need to hide) but thats the general idea.

Re: How to hide content from users on template pages

PostPosted: January 25th, 2012, 11:51 am
by Eduan
Well, you could use advanced conditionals, based on custom capabilities.

Check under WP Admin -> s2Member -> API / Scripting -> Custom Capabilities Packages, in there you should find info about custom capabilities, and conditionals for using them.

You could also check these videos:
http://www.s2member.com/custom-capabilities-video/
http://www.s2member.com/advanced-conditionals-video/

Hope this helps. :)