WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Show welcome page only to users that are not logged on

[Resolved] Show welcome page only to users that are not logged on

Viewing 3 replies - 1 through 3 (of 3 total)
  • mrmist
    Forum Janitor

    @mrmist

    Bit of a hack but – Within the index template before anything else happens you could do something like

    <?php
    if (!$user_ID)
    { header(‘Location: http://www.example.com/welcome‘);
    exit;}
    ?>

    sparkguitar05
    Member

    @sparkguitar05

    It looks like you are on the right track, but it doesn’t work right. When I go to http://www.example.com it redirects to http://www.example.com/welcome, but I get the following message in Firefox.

    The page isn’t redirecting properly
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    To clarify what I did: I copied your code to the very top of index.php on the root of my website and changed the URL from example.com to my own URL.

    Let me know if I am doing something wrong.

    sparkguitar05
    Member

    @sparkguitar05

    Never mind I fixed it.

    For those of you who want to know, the code is supposed to go in the theme index.php file, not the root index.php file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Show welcome page only to users that are not logged on’ is closed to new replies.