Managing state in wordpress

 

Sometimes we want to display a different button for when you are logged-in and another for when you are not.. (See pictures)
Login button example
logout button example

/*we figure out if user is logged in?  If not logged in, show <login> button, else show <logout> button */

     a href=’/ wp-login.php”target=“new” class=“login”> login

     <a href="http://chilligavva.com/wp-admin/%E2%80%9C%3C">/ wp-login.php?action=logout” target=“new” class=“logout”> logout </a>

     <br clear="“all”" />
</logout></login>

Instead of styling the link classes, you can also just change the text message to say whatever you want.