WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show Link if Member (6 posts)

  1. Nate
    Member
    Posted 5 years ago #

    In my sidebar, I want to show a link, if the user is logged in. If the user is not logged in or is not a member, don't show the link.

  2. roya khosravi
    Member
    Posted 5 years ago #

    <?php if ( $user_ID ) : ?>
        Show my link
    <?php else : ?>
        Hide my link
    <?php endif; ?>
  3. Nate
    Member
    Posted 5 years ago #

    What would I put in the "Hide my link"? Nothing?

  4. Yep. Or this:

    <?php if ( $user_ID ) : ?>
        Show my link
    <?php endif; ?>

    Leave out the else :)

  5. Nate
    Member
    Posted 5 years ago #

    Thanks

  6. Zilver
    Member
    Posted 5 years ago #

    i put this on my site and when i'm logged in it shows nothin how come?

Topic Closed

This topic has been closed to new replies.

About this Topic