Scroll to top

How to display different links for logged in and logged out users?

Author
Conversation
Share on facebook
Share on google
Share on twitter
Share on linkedin
<div class="fr">             
    <ul class="rss">                  
        <li><a href="http://example.com/go/wp-login.php">Support</a></li>                 
        <li><?php if (is_user_logged_in() ) { 
                echo " <a href=\"" . wp_logout_url() . "\" title=\"Logout\">Logout</a>";
            }else{ 
                echo " <a href=\"http://example.com/" title=\"Login\">Member Login</a>";
            } ?>
        </li>             
    </ul>         
</div> 

In case of redirecting you can use  wp_logout_url(home_url()) to redirect it to Homepage.

envato iconUpwork Profile