WordPress.org

Ready to get started?Download WordPress

Forums

first time visitor message (2 posts)

  1. backin2shape
    Member
    Posted 4 years ago #

    I am looking for a way to display a "welcome message" once a user registers for the site. any help is appreciate.

  2. Brandon Allen
    Member
    Posted 4 years ago #

    Something like this should get you started.

    global $user_ID;
    if( $user_ID ) {
    	$user_info = get_userdata( $user_ID );
    	// If user_registered date/time is less than 48hrs from now
    	// Message will show for 48hrs after registration
    	if ( strtotime( $user_info->user_registered ) < ( time() + 172800 ) )
    		echo 'Welcome, ' . $user_info->display_name . '. Thanks for registering.';
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.