Page 1 of 1

Lockout Site

PostPosted: December 12th, 2011, 8:54 pm
by Silver Bullet
Hey All,

I've recently installed s2member and can't seem to find a way to lockout the whole site. I'd like to have the first page an unregistered/not-logged in user sees is simply the registration form (I'd edit to make it clear what they need to do)

Any help on how this would be done would be very helpful.

Thanks
SB

Re: Lockout Site

PostPosted: December 12th, 2011, 10:07 pm
by Eduan
You may be interested in this post;
viewtopic.php?f=4&t=2287

Hope this helps. :)

Re: Lockout Site

PostPosted: December 13th, 2011, 9:33 am
by Silver Bullet
Those weren't bad solutions ... but since I get the idea now .. I figured out something a little easier:

In you index.php (of your theme file) above the <? get_header(); ?> put:

<?php if(!is_user_logged_in()){ ?>
<?php header( 'Location: http://www.nameofsite.com/wp-login.php?action=register' ) ; ?>
<?php } else { ?>

then above <?php get_footer(); ?> put the following in:

<?php } ?>

---

Basically you're saying if the person isn't logged in as a user push them to the s2member registration page, otherwise show the page as normal. I've tested this quickly and seems to be ok. If anyone has problems/questions just post here and I'll take a look.

Re: Lockout Site

PostPosted: December 13th, 2011, 9:54 am
by Eduan
The code looks good, doesn't seem to be any problems in it.
Good job on doing this! And thanks for sharing this with others.