How to check a user is logged in or not – wordpress

<?php  if (is_user_logged_in()){?>

<li><a href=”<?php  bloginfo(‘url’); ?>/wp-admin”>Site Admin</a></li>

<li><a href=”<?php  bloginfo(‘url’); ?>/wp-login.php?action=logout&amp;_wpnonce=f17bcd0114″>Log out</a></li>

<?php } else { ?>

<li><a href=”<?php  bloginfo(‘url’); ?>/wp-login.php”>Log in</a></li>

<?php }; ?>

Share

Leave a Reply

Your email address will not be published. Required fields are marked *