Page 1 of 1

Page Restrictions

PostPosted: August 3rd, 2010, 3:55 pm
by webboy
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 ?

Re: Page Restrictions

PostPosted: August 3rd, 2010, 5:24 pm
by me me
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

?>

Re: Page Restrictions

PostPosted: August 5th, 2010, 1:02 pm
by Jason Caldwell
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/