I’m using the following text to show when and if someone is logged in.
<?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?> | You are not /wp-login.php?redirect_to=<?php the_permalink(); ?>”>logged in.<?php else : ?><?php if ( $user_ID ) : ?> | You are logged in as /wp-admin/profile.php”><?php echo $user_identity; ?>.<?php endif; ?>
When their not logged in, it shows nothing. When they are logged in, it says who they are logged in as. The only time it says “not logged in” is when I don’t allow non-registered users to reply to posts. I’m sure comment_registration is not the right get_option. Can someone help me out with this please?
- The topic ‘Want it to Show “Not Logged In”’ is closed to new replies.