So I am trying to check if a user is logged in with the default WP function but it doesn't seem to work. Oddly, it works fine for people logged in (it echoes as it should) but it echoes nothing for people who aren't logged in. Anyone seen this behaviour?
if ( is_user_logged_in() ) {
echo 'logged in';
} else {
echo 'not logged in';
}
This is put in the functions.php file