I am running WordPress
3.3.2 with multi site
in subdomain mode.
I want to add a new subdomain
but have it be “offline” until I finish working on it. Is there an easy way to do this?
I know that if its a single site I can just add an if
in the header file and the site will be online only to me, but in this case all of my sites are using the theme, making it the same header file thus making this solution invalid.
Your easiest route is probably to use a plugin like Restricted Site Access (disclaimer: written by my boss) to redirect a user who isn’t logged in elsewhere, like the network home or something else. There are a few other similar plugins out there.
Another option would be to take the code you say you’d put in your theme and make your own little plugin with it instead. Then you can activate it for just that site. You’d need to be careful about which hook you use to check the user and then redirect.
Have you considered developing locally or on a development server and then transfering the theme/plugins/database over to your sub-site?
I would recommend it as it gives you a speed up in development time, you can test changes without worrying about affecting live users and you don’t have to worry whether or not anyone can see your ‘offline’ site because it’s literally on your own machine (or on your development server).
However, if that strategy is not viable for you or you simply don’t wish to change your workflow – you could try a coming soon plugin which allows you as an admin to edit and view your site and shows a placeholder page to everyone else.