Check if user is logged in

Wpsnipp – Using this PHP code in your wordpress theme will let you display alternate content to users that are logged in. You could use this to display a custom message to logged in users eg: register or welcome message for members.

 

 

<?
if (is_user_logged_in()) {
/* yes user is logged in */
}else{
/* no user is not logged in */
}
?>

Be Sociable, Share!

Leave a comment