Making Simple Coming Soon and Under Construction work with Child Themes

It’s quite possible that there are other maintenance and ‘coming-soon’ plugins out there that are more up to date, slicker and better than this one, but for whatever reason I’ve used Simple Coming Soon and Under Construction for a number of years. Unfortunately, in more recent times I have found it not performing to my liking in that while it would display a splash screen when it was in ‘maintenance’ mode it was never my custom one.

As it happens this non-performance coincides with the advent of my diving into developing using child themes…

Turns out it only needed a little tweak to perform the way I need it to. I’ll document it here for posterity, and perhaps for someone else’s edification. But what will likely happen is that I’ll end up finding a slicker newer, more up to date plugin and this post will become obsolete…

In any case…

The plugin finds your custom page by picking up the custom coming-soon.php you’ve placed in the current theme directory, but because it’s calling the function get_template_directory to find the above file it expects to find it in the parent theme directory (in most cases for me, Genesis). It’s a simple fix, just change that function to get_stylesheet_directory at line 72.

Instead of this…

[php firstline="72"]$dir = get_template_directory().’/’;[/php]

use this

[php firstline="72"]$dir = get_stylesheet_directory().’/’;[/php]

Having done that, you can go on and copy your coming-soon.php to your theme directory and have your custom coming soon page display as it was intended. This is my custom page. I have some nice little bits of php that throw in the details of the site I’m working over so I all I have to do is set and forget it…

The_Web_Princess_is_Building_or_Updating_this_Website

Oh… you want to know those little bits of php?

Ok… easy…

First up is putting the Blog Name in the Page Title
[php]<?php bloginfo(‘name’); ?> | Maintenance Page[/php]
Second is putting the Stylesheet directory in the img urls so I don’t have to code those every time I upload this coming soon file to a new site.
[php]img src="<?php bloginfo(‘stylesheet_directory’); ?>/comingsoon_images/spacer.gif" alt="" width="960" height="36" />[/php]
Then there’s the name again
[php]<Hi! You have reached <?php bloginfo(‘name’); > – Sorry to have missed you! [/php]
Then there’s the admin email address
[php]Or you can contact us by emailing us at <?php bloginfo(‘admin_email’); >[/php]
Oh… wait… you’re not sure how to make a php file in the first place? That’s easy… create your html page, like you would any other. Replace the relevant bits of code in it with those php tags as above and save it as .php instead of HTML.

Enjoy!