Home / login / Check if user is logged in
  • How to Check if user is logged in

    no thumbnail sorry: Check if user is logged in

    Using this PHP code in your wordpress theme will let you display alternate content to users that are logged in. You could use this to display a custom message to logged in users eg: register or welcome message for members.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    <?
              if (is_user_logged_in()) {
                          /* yes user is logged in */
                  }else{
                          /* no user is not logged in */
                  }
    ?>
    

    ( WordPress codex functions, hooks, in this snippet. )

    is_user_logged_in,