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™

Page Restrictions

s2Member Plugin. A Membership plugin for WordPress®.

Page Restrictions

Postby webboy » August 3rd, 2010, 3:55 pm

Hi all i hope somebody can help here

I wish to create a template page that will have the restriction levels hard coded in , eg lets say I have a template page for gold level members and in the template file have a bit of code at the top for the access level.
so i can use the template over and over for the the page

My goal is not to have to log in to the blog to set the page number to restrict each page is it possible? if so what would be the php code to put in place ?
User avatar
webboy
Experienced User
Experienced User
 
Posts: 11
Joined: August 3, 2010

Re: Page Restrictions

Postby me me » August 3rd, 2010, 5:24 pm

Found it ,,

?php if (current_user_can('s2member_level1')) { // put your access level here

echo ('hello');


} else { echo 'goodbye'; } // or even redirect them out to another page or include some text

?>
me me
Guest User
Guest User
 

Re: Page Restrictions

Postby Jason Caldwell » August 5th, 2010, 1:02 pm

Great. Thanks for reporting back on this.
~ Much appreciated.

I've also done a video tutorial on this topic that might help:
http://www.s2member.com/advanced-conditionals-video/
~ 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: Google [Bot], Yahoo [Bot] and 1 guest

cron