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™

checking membership level

s2Member Plugin. A Membership plugin for WordPress®.

checking membership level

Postby MARK » July 5th, 2010, 6:19 am

Hi.
I want to exclude a part of the site hardcoded by myself.
So looking for something like:

if(is_membership_level(bronze)){
/////print content
}else{
////print protected area info
}
MARK
Guest User
Guest User
 

Re: checking membership level

Postby marek » July 5th, 2010, 6:22 am

Just found, sorry..

<?php if (is_user_logged_in() && current_user_can("access_s2member_level1")){ ?>
Some content for Members who are logged in with an s2Member Level >= 1.
<?php } else { ?>
Some public content.
<?php } ?>
marek
Guest User
Guest User
 

Re: checking membership level

Postby Jason Caldwell » July 8th, 2010, 6:09 am

Awesome. Thanks for the followup.
For the benefit of other readers, you can find documentation on "Advanced Conditionals", inside your WP Dashboard, under: s2Member -> API Scripting -> Advanced Conditionals.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 1 guest

cron