Page 1 of 1

Add Login / Logout to top navigation.

PostPosted: February 8th, 2011, 12:27 am
by urbanryno
I'm just looking for a simple script to add to my header file that adds the text "Login" if they are not currently logged in or "Logout" once they are logged in. Seems simple. I just cant figure it out. Ug.

Thanks for the help.

Re: Add Login / Logout to top navigation.

PostPosted: February 8th, 2011, 6:04 am
by camillemm
Search in Google for "login form wordpress".

Re: Add Login / Logout to top navigation.

PostPosted: February 8th, 2011, 2:58 pm
by nhsatomom
This is what I use:

Code: Select all
<?php if(is_user_logged_in()){ ?>
<a href="<?php echo S2MEMBER_LOGIN_WELCOME_PAGE_URL; ?>">Member Home</a>
| <a href="<?php echo S2MEMBER_LOGOUT_PAGE_URL; ?>">Logout</a>
<?php } ?>
<?php if(!is_user_logged_in()){ ?>
<a href="http://domain.com/commons/wp-login.php">Login</a>
<?php } ?>

It adds an extra link after they've logged in ("member home"), so strip that out if you don't want that feature.

Re: Add Login / Logout to top navigation.

PostPosted: February 8th, 2011, 6:48 pm
by urbanryno
I LOVE YOU !!!! That's what i needed.
thanks.