Want it to Show "Not Logged In" (3 posts)

  1. shilocase
    Posted 9 years ago #

    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?


  2. MichaelH
    Posted 9 years ago #

    Would using the template tag, wp_loginout, work for you?

  3. shilocase
    Posted 9 years ago #

    oh duh ... the wp_loginout worked great for what I was trying to do. I was so deep in the jungle I didn't see the daylight. :)


Topic Closed

This topic has been closed to new replies.

About this Topic