How to check login status in wordpress

Using “is_user_logged_in” function You can check user login or not. e.g <?php if(is_user_logged_in()): ?> echo “Insert your HTML or PHP code here”; <?php else: wp_die(‘Sorry, you must first <a href=”/wp-login.php”>log in</a> to view this...