PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

How Do I Hide Posts For Members?

s2Member Plugin. A Membership plugin for WordPress®.

How Do I Hide Posts For Members?

Postby jetheat » November 8th, 2010, 8:00 pm

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
User avatar
jetheat
Registered User
Registered User
 
Posts: 8
Joined: October 16, 2010

Re: How Do I Hide Posts For Members?

Postby ndavidson » November 8th, 2010, 8:55 pm

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.
ndavidson
Guest User
Guest User
 

Re: How Do I Hide Posts For Members?

Postby jetheat » November 9th, 2010, 9:48 am

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).
User avatar
jetheat
Registered User
Registered User
 
Posts: 8
Joined: October 16, 2010

Re: How Do I Hide Posts For Members?

Postby ndavidson » November 9th, 2010, 4:04 pm

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.
ndavidson
Guest User
Guest User
 

Re: How Do I Hide Posts For Members?

Postby jetheat » November 9th, 2010, 5:25 pm

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?
User avatar
jetheat
Registered User
Registered User
 
Posts: 8
Joined: October 16, 2010

Re: How Do I Hide Posts For Members?

Postby ndavidson » November 9th, 2010, 7:34 pm

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.
ndavidson
Guest User
Guest User
 


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 4 guests

cron