Logout Fuction in an echo statement?
-
Can anyone help me out? I have an if statement checking if users are logged in and then if they are showing them a link to their dashboard and logout link. I cannot get the function to work in the echo statement though! I would like the logout link to log them out & redirect to the current page and have it also say Welcome, username! instead of Welcome, friend!
Check out my code below:
<?php if (is_user_logged_in()){ echo "<h3><span class='slash'>//</span>Welcome, Friend!</h3><br /><br /><li><a href='https://blog.complimedia.com/wp-admin/'>Your Dashboard</a></li><li><a href='/wp-login.php?action=logout' title='Log out of this account'>Log out</a></li>";} else { echo "<h3><span class='slash'>//</span>Welcome, guest!</h3><br /><br /><li><a href='/wp-login.php'>Sign In Here</a></li>"; }; ?>
Thanks so much!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Logout Fuction in an echo statement?’ is closed to new replies.