Recently, I had a client that wanted to make some changes to their site content. They have a yearly event so every year all the information changes. She wanted a way to display a landing page display for all her visitors while she made changes to her site in the backend and updated all the content. However, she needed to be able to see the site as it actually is and not the landing page.
With this requirement in mind, I set out trying to find a solution that would allow her to make edits to the site and view them on the front end, while at the same time show a different landing page to any other user. As per my normal course, I turned to the WordPress Plugin repository, where I found a great plugin, called Theme Test Drive (http://wordpress.org/plugins/theme-test-drive/). The description says it all:
Safely test drive any theme as an administrator, while visitors use the default one.
This was exactly what I was looking for. So for this to work as I wanted, I needed to pull what I knew from themes to create a “landing page” theme. That was the easy part. Per the WordPress codex, a theme requires 2 files in order for it to function properly, a css file and a index.php file. I had already created the landing page as a static HTML page, so I just renamed that file to “index.php”. Then, in the style.css file, I put this information in:
/* Theme Name: Landing Page Holding Theme Theme URI: www.aclientssite.com Description: Holding page for site for normal visitors to see Version: 1.0 Author: Chris Klongpayabal Author URI: https://www.klongdesigns.com */
That’s it! I put these two files into my themes directory folder called “holding”, then uploaded it to my server.
In the WordPress backend, I activated that theme. Now all the regular users would see this theme index page no matter what URL they went to (even 404 pages went here).
Then, under Appearance > Theme Test Drive, I selected the theme we were going to be making edits to in the drop down box, then set the access level to 10 (administrators). Once I verified these settings, I clicked on “Enable Theme Drive”. Just like magic, the client could see the site when she was logged in but anyone else would just see the landing page holding theme.