Page 1 of 1

Members Can't Logout

PostPosted: June 22nd, 2010, 10:36 am
by peterjr
I just setup s2Member and when I logged in a free member for testing, I can't logout. There is no log out link anywhere. Did I miss something during setup? A link to wordpress admin show at the bottom, but that's it.
Do I have to specify logout pages and links?

Re: Members Can't Logout

PostPosted: June 22nd, 2010, 10:52 am
by Jason Caldwell
You can either add a Meta widget to your Sidebar in WordPress, or use a plugin like this one:
http://wordpress.org/extend/plugins/sidebar-login/

s2Member does NOT introduce anything new to your theme by itself. You have to create your own Membership Options Page, Login Welcome Page, and if you want logout links, you can use the tools built into WordPress for that, or apply widgets to a Sidebar, like the one I listed above.

For developers, s2Member makes an API Constant available:

S2MEMBER_LOGOUT_PAGE_URL
This is the full URL to the Membership Logout Page ( the WordPress® logout page ).
Code: Select all
<?php if (S2MEMBER_CURRENT_USER_IS_LOGGED_IN){ ?>
  <a href="<?php echo S2MEMBER_LOGIN_WELCOME_PAGE_URL; ?>">My Account</a>
  | <a href="<?php echo S2MEMBER_LOGOUT_PAGE_URL; ?>">Logout</a>
<?php } ?>

All of s2Member's API Constants are documented inside your WordPress Dashboard, under:
s2Member -> API /Scripting -> Constants

Developers can also just use this built-in WordPress function:
Code: Select all
wp_logout_url()

Re: Members Can't Logout

PostPosted: June 22nd, 2010, 11:35 am
by peterjr
Thank you Jason. I got it to work. One of my widget areas wasn't working so I couldn't see the links.

Re: Members Can't Logout

PostPosted: June 22nd, 2010, 12:59 pm
by Jason Caldwell
Awesome. ~Thanks for reporting back.