How to display a page only to non-logged users?

Discussion in 'WordPress' started by avatar33, Oct 6, 2010.

  1. #1
    Hey all,

    I want a page entitled "Sign Up For Free!" to appear in the top navigation menu only when a visitor is NOT logged in. This tab should disappear if the user logs in.

    I'm using Atahualpa theme latest version.

    Is this possible?
     
    avatar33, Oct 6, 2010 IP
  2. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this , it will help you ,please add reputation if it helps you out

    
    <?php if ( is_user_logged_in() ) {} else { ?>
    the login box code , or what ever you want the non logged in user must see
    <?php } ?>
    
    Code (markup):
     
    Wp-Mod.Com, Oct 6, 2010 IP
  3. anupviews

    anupviews Member

    Messages:
    795
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    35
    #3
    <?php
    if ( is_user_logged_in() ) { echo "Welcome back"; } else {
    ?>
    <div style="position:fixed; top:0; left:0;">Subscribe to my blog</a>
    <?php
    };
    ?>
     
    anupviews, Oct 7, 2010 IP