Thanks for the great question.
I sincerely apologize for the delayed response.
wordpressmania wrote:How can I exclude some arbitrary post (that are in the "modules", protected catecgory) so that thay show up anyway even to non registered users?
Maybe the more general question could be: how the restriction applyed at category level can be "by-passed" with conditional API?
OK. First off... ( for the benefit of other readers ) I don't recommend this. Instead, I would consider a fundamental restructuring of the way your "members only" content is grouped together, and/or categorized. s2Member makes a lot of methods available, that do NOT require the additional routines I'm about to describe. You can just use the s2Member -> General Options panel instead ( much easier ).Now, to answer your question.You will need to ( NOT protect ) the categories with s2Member, and instead, integrate your own Advanced Conditionals; inside your WordPress theme. Depending on how your theme is built, this will probably be inside your /index.php file. You will find a section that looks something like this:
The famous WordPress Loop- Code: Select all
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
the_content();
endwhile;
endif;
?>
So you could do something like this, integrating some
conditionals:
- Code: Select all
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
if(has_tag("members-only") && !current_user_can("access_s2member_level1"))
continue;
else the_content();
endwhile;
endif;
?>
So here, you are telling your theme to continue ( i.e. not to show ) any Post that has the tag "members-only". You can follow this link for a more in-depth look at WordPress
Conditional Tags.
I've also done a video tutorial here on the topic of Advanced Conditionals:
http://www.s2member.com/advanced-conditionals-video/