WordPress Tip: A Custom Welcome Message for your Users

Published March 29, 2008 1 Comment 0 Delicious Bookmarks

I recently published an article over at WPDesigner that gave detailed instructions on how to create a WordPress backed membership community. A working community site will have it’s members returning every so often to log in and update their information. A simple way to encourage this behavior is to display a custom welcome message (something that WP doesn’t natively do) whenever an already-logged-in member revisits your site.

In the example below I display a default message encouraging new sign ups, but whenever an already registered and signed in member is on the site, it shows them a welcome message using their username and encourages them to edit their profile.

<?php if (is_user_logged_in()) { ?>

<div class="acct-signedin">
   <p>Hello <?php global $user_login; get_currentuserinfo(); echo $user_login; ?> |
   <a href="<?php bloginfo('url'); ?>/wp-admin/profile.php">Edit your profile</a>,
   <a href="<?php bloginfo('url'); ?>/wp-login.php?action=logout">Sign out</a></p>
</div>

<? } else { ?>

<div class="acct-signedout">
   <p><a href="<?php bloginfo('url'); ?>/wp-register.php">Create an Account</a> |
   Already a member? <a href="<?php bloginfo('url'); ?>/wp-login.php">Sign in</a></p>
</div>

<? }; ?>

This entry was posted under Tutorials, Wordpress and has an RSS feed
1 Comment | Save to Del.ico.us |  

1 Comment

  1. June 5th, 2011 @ 1:12 pm

    Janis said:

    Thanks for sharing this.

    I just cannot find any information of how to edit the text right below the logo on login page. Could you please show an easy way to do this?

    Janis

Leave your Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get your own Gravatar