latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Add Login and Logout Links in Top Menu Nav

Home Forums Community Forum Add Login and Logout Links in Top Menu Nav

This topic contains 5 replies, has 2 voices. Last updated by  Eduan 4 years, 4 months ago.

Topic Author Topic
Posted: Saturday Aug 25th, 2012 at 5:05 pm #23090
Mike Waller
Username: seozones

I want to place a Logout link in my main Menu nav bar (after user logs in of course). I’m using Menus under Appearance in my dashboard. Also, what would the php code be to add in both links and where would it go (functions.php file?)?

I currently have a Login link in the menu bar and would like it replaced with Logout if user is logged in. I have the code for the logout link.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Saturday Aug 25th, 2012 at 5:21 pm #23091
Mike Waller
Username: seozones

I think I figured it out thanks.

Posted: Saturday Aug 25th, 2012 at 6:04 pm #23094
Eduan
Username: Eduan
Moderator

Hello Mike,

That’s strange, I thought I answered to this topic. :|

Glad you were able to solve your problem though. :)

Posted: Saturday Aug 25th, 2012 at 6:07 pm #23096
Mike Waller
Username: seozones

Well I found the Logout url but now can’t this to work the way I want to. In my header.php file I hard coded in the menu links (from the source code). Now I’m trying to place in the following but the php code is converting to a string so the Logout link is not working properly. Any suggestions? This is what I have:

< ?php
if ( is_user_logged_in() ) {
echo '<a href="” title=”Logout”>Logout’; }
else {
echo ‘Login‘;}
?>

Posted: Sunday Aug 26th, 2012 at 12:23 am #23100
Mike Waller
Username: seozones

Okay, I got it to work using this:

< ?php

if ( is_user_logged_in() ) {
echo 'Logout’;
} else {
echo ‘
Login‘;
}

?>

Posted: Sunday Aug 26th, 2012 at 9:05 am #23114
Eduan
Username: Eduan
Moderator

Glad you figured it out Mike! :)

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.