X

How to check if a user is logged in on WordPress blog

Below code will check if a user is logged in, this code can use when you want to show a custom message (Eg: welcome MSG) to users who logged in.

 
	<?php
	  if (is_user_logged_in()) {
				  /* Show welcome MSG here */
		  }else{
				  /* no user is not logged in */
		  }
	?>