WordPress.org

Support

Support » Plugins and Hacks » Fixed: Load Content Based on User

Fixed: Load Content Based on User

  • <?php
    global $user_ID;
             global $userdata;
          get_currentuserinfo();
    if (is_user_logged_in()){
               echo "Welcome, $userdata->user_login!";
             }
             else {
               echo "Welcome, visitor!";
               };
    ?>

    I made this code, so i can load user Based content. The one in the codex was not working alone (i maybe did something worng) so i combined that to make what i needed. I am also loading the userdata so u can print, any variable from user profile u want.

    Hope it helps some ppl 😀

  • The topic ‘Fixed: Load Content Based on User’ is closed to new replies.
Skip to toolbar