[resolved] Show something only to guests (3 posts)

  1. Visnes
    Posted 7 years ago #

    Is there any way to make something only show to people who aren't registered?

    I want to add a link to the registration page, but only have it show if the user isn't logged in. The below worked the other way around. :P Any similar function like that with "is_user_guest" or something?

  2. <?php if ( is_user_logged_in() ) { ?> Registrer deg! <?php } ?>
  3. Thanks for any help. :)

  • if ( ! is_user_logged_in() ) {

    The ! means "not" in PHP.

  • Visnes
    Posted 7 years ago #

    Thank you very much. :) Worked like a charm. ^^

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic