Community Support Forums — WordPress® ( Users Helping Users ) — 2011-07-19T22:33:52-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=13003 2011-07-19T22:33:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=28669#p28669 <![CDATA[Re: Hide specific content on specific pages]]> WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals -> Example #1.

Code:
<?php if(is_user_logged_in()){ ?>
    Content for anyone that is logged in, regardless of their Membership Level.
<?php } else { ?>
    Some public content.
<?php } ?>


I hope that helps.

Statistics: Posted by Cristián Lávaque — July 19th, 2011, 10:33 pm


]]>
2011-07-18T14:01:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=28619#p28619 <![CDATA[Re: Hide specific content on specific pages]]> Statistics: Posted by hazardous_waster — July 18th, 2011, 2:01 pm


]]>
2011-07-11T20:54:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=28156#p28156 <![CDATA[Re: Hide specific content on specific pages]]>
PseudoNyhm wrote:
I recently installed TRUEedit, which allows you to switch off the WordPress formatting. This makes the HTML editor a true source editor (what you type will be what ends up as the page source).


Brilliant tip! Thanks! :D

cassel wrote:
I am not coder either but if you look under API / Scripting > Advanced Conditionals, you might find other codes to enter. I am not 100% it will work but worth a try until someone more knowledgeable chimes in.


Correct. :)

Statistics: Posted by Cristián Lávaque — July 11th, 2011, 8:54 pm


]]>
2011-07-11T13:50:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=26429#p26429 <![CDATA[Re: Hide specific content on specific pages]]> Statistics: Posted by cassel — July 11th, 2011, 1:50 pm


]]>
2011-07-11T13:45:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=26427#p26427 <![CDATA[Re: Hide specific content on specific pages]]>
I recently installed TRUEedit, which allows you to switch off the WordPress formatting. This makes the HTML editor a true source editor (what you type will be what ends up as the page source).

Statistics: Posted by PseudoNyhm — July 11th, 2011, 1:45 pm


]]>
2011-07-11T13:42:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=26426#p26426 <![CDATA[Re: Hide specific content on specific pages]]>
[s2If is_user_logged_in()]
Content for anyone that is logged in, regardless of their Membership Level.
[/s2If]

But what I'm asking is can I on a page template, say I make a new one called 'switching-content.php' is there something I can write to do a similar thing for example

<? if (user is loged in)
{
<div> display this lovely div! </div>
} else
{
<div> they'll see this horrible one! </div>
} ?>

Yeah as you can see I'm no php coder, but I hope that explains what I'm after

Statistics: Posted by hazardous_waster — July 11th, 2011, 1:42 pm


]]>
2011-07-11T13:23:52-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=26424#p26424 <![CDATA[Re: Hide specific content on specific pages]]> Statistics: Posted by cassel — July 11th, 2011, 1:23 pm


]]>
2011-07-11T13:13:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=26423#p26423 <![CDATA[Re: Hide specific content on specific pages]]>
N

Statistics: Posted by hazardous_waster — July 11th, 2011, 1:13 pm


]]>
2011-07-09T07:13:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=25769#p25769 <![CDATA[Re: Hide specific content on specific pages]]> Statistics: Posted by hazardous_waster — July 9th, 2011, 7:13 am


]]>
2011-07-09T07:09:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=25768#p25768 <![CDATA[Re: Hide specific content on specific pages]]>

Content for everyone to see.
[s2If is_user_logged_in()]
Content for anyone that is logged in, regardless of their Membership Level.
[/s2If]


So whatever is wrapped in the conditional will only be displayed to logged in members. The others will not even see there is something there. And of course, the conditionals like that can take many forms and get more complex. Just as an example:
http://scrapbookcampus.com/basic-tutori ... tshop-pro/

In that page, some content is viewable by ALL, but if you are logged in, some content will appear, other will disappear, and if you are a paying member, still different content will display. It is fun to play with!

Statistics: Posted by cassel — July 9th, 2011, 7:09 am


]]>
2011-07-09T06:03:30-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13003&p=25298#p25298 <![CDATA[Hide specific content on specific pages]]>
Right I've had a look round the forums and can't find how to do this one. What my client wants to do is when a user is loged on to the site they'll see an extra chunk of content with extra content in at the bottom of the pages, so what I'd like is some sort of tag I can put on a div (don't mind if its ard coded in to the page template) or something I can wrap around said chunk of content so that'll only display to people who are loged in ... I had a look at the tags thing in s2member but that goes about about specific posts or pages ... not taging content on pages.

make sense? possible?

Thanks in advance,
Neil Kelsey

Statistics: Posted by hazardous_waster — July 9th, 2011, 6:03 am


]]>