Forums

[resolved] Welcome message broken with 2.0 upgrade. (3 posts)

  1. alsosara
    Member
    Posted 3 years ago #

    With WP 1.5, this script worked well, but no more in 2.0. The script doesn't recognize anyone as logged in. It's probably such a simple change I need to make, but still I don't know what to do. Could someone help me update this?

    <?php get_currentuserinfo();
    if ( $user_nickname<> "" ) { ?>
    <p class="credit">Hey <?php echo $user_nickname ?>.
    <?php } else { ?>
    <p class="credit">Thanks for visiting. FYI, you're only seeing a fourth of the posts. Login or register to fix that.
    <?php } ?>

    Thanks much in advance!

  2. Kafkaesqui
    Moderator
    Posted 3 years ago #

    $user_nickname is no longer available (due to the changes in the user table). Try this:

    <?php get_currentuserinfo();
    if ( $user_login ) { ?>
    <p class="credit">Hey <?php echo $userdata->nickname; ?>.
    <?php } else { ?>
    <p class="credit">Thanks for visiting. FYI, you're only seeing a fourth of the posts. Login or register to fix that.
    <?php } ?>

  3. alsosara
    Member
    Posted 3 years ago #

    Thanks so much. That worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic