We are not talking about a pop-up or setting a page as the homepage of your WordPress site here. A real solid page that is shown to visitors when they enter your site from another site, or search engine (which again is another site) or by directly typing in your address.
Have you ever seen this sign “If you are below 18 leave now, else Enter here” (yeah, the smile on your face explains it)? You see that sign when you enter first and that’s that. Lets make one such page.
Making a “Enter Site” Page
Depending on your theme, your theme folder will have home.php or index.php or sometimes both in your theme folder. If you have home.php open it up, else go for index.php. Refer the template hierarchy if that interests you. I am assuming my theme has index.php only.
Add the following code snippet at the start of index.php. Start as in, the very first line, before everything and everything. On line 1:
Now you opened close the if else by adding the following to the end of index.php. End as in the last line:
That makes index.php in between those two codes.
What this does is, if the user is entering from anything but your own site, it will show:
Go ahead and make a copy of
page.php in your theme folder and name it
page-splash.php . If hope you have figured that you have to replace
http://yourdomain.com/wp-content/themes/yourtheme/page-splash.php in the above snippet with the direct link to your
You will have to hard-code your page-splash.php. The best way to do this is to look at the source code of a page on your site and imitate them into your
page-splash.php. Well, I am thinking, if you just copy paste the code, that should also work.
Here is a little
page-splash.php that I made for Twenty Ten default WordPress theme:
* The Splash Page
Welcome to my awesome site!
Welcome to my site. You can read my instructions here and then enter the site here
To test the welcome page, open up a new tab and enter your site into the browser. Lo!
Hope you have fun creating the Welcome Page. Do let me know what you think.