Page 1 of 1

How Do I Hide Posts For Members?

PostPosted: November 8th, 2010, 8:00 pm
by jetheat
On my WP blog front page, I have many blog posts which are made specifically for non members.

Then when I create a blog post for a member, I don't want it to appear amongst the hundreds of non member posts on the front page.

So how do I avoid having posts for members appearing amongst the non member posts.

I want the members to see these special posts once they have logged in.

At the same time, I don't want members who are logged in to see the public posts coz they will only clutter the space.

Any suggestions?


JH

Re: How Do I Hide Posts For Members?

PostPosted: November 8th, 2010, 8:55 pm
by ndavidson
use level 0 for free members and set up a conditional for any posts you only want specific member privs to be able to view.

Re: How Do I Hide Posts For Members?

PostPosted: November 9th, 2010, 9:48 am
by jetheat
I dont have any free members. I don't want any public to have to register to become a free member just so they can view my open posts.

When the public arrive at my site, they see open/public posts.

How do I set up conditionals?

But more importantly, how do i separate the public posts from the private ones so they are not mixed together in one area (like on the front page).

Re: How Do I Hide Posts For Members?

PostPosted: November 9th, 2010, 4:04 pm
by ndavidson
In the backend of wordpress, go to s2member=>API / Scripting

For what you need, all your answers can really be found there.

ie:

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


Another example is:

Code: Select all
<?php if (current_user_is("s2member_level1")){ ?>
    Content for Members at exactly Level# 1.
<?php } else if(current_user_is_not("s2member_level4")) { ?>
    Some content for those who are NOT at Level #4.
<?php } else if(is_user_not_logged_in()) { ?>
    Some public content.
<?php } ?>


Best place to put this, in my opinion, would be in your main theme header.

Additionally, you can have PrimoThemes do a custom installation, though I have yet to figure out how to directly contact them for such services.

Re: How Do I Hide Posts For Members?

PostPosted: November 9th, 2010, 5:25 pm
by jetheat
Thanks for this. Unfortunately, I dont know what to put where as I dont know any programming at all.

But does it mean I have to specify posts by ID (each one of them) to hide them?

Re: How Do I Hide Posts For Members?

PostPosted: November 9th, 2010, 7:34 pm
by ndavidson
Unfortuanately, what you are wanting to do does/will require some programming knowledge.

There are enough freelance programmers out there that could make the adjustments at a reasonable price or, if you want to learn yourself, I'd suggest starting at W3C Schools (http://www.w3schools.com/).

Specifically the PHP section (http://www.w3schools.com/php/default.asp)

Like I mentioned, the guys who made the plugin would be the best ones to hire to customize things for you. The rate of investment for hiring them is pretty favourable when considering having to deal with unkown programmers and/or trying to teach yourself to program.