Snippets

Redirect non logged in users

Bung this at the top of your index.php, home.php or custom front page and it will redirect non logged in users to a page called holding.php
An excellent way to develop a site on a live url.

<?php
/* Template Name: Custom Page */
if ( !is_user_logged_in()) {
get_template_part('holding');
exit(0);
}
get_header();
?>

Source: http://www.squareonemd.co.uk/developing-a-wordpress-site-on-...

Share this snippet

 
  • http://www.squareonemd.co.uk Elliott Richmond

    Hey thanks for posting ;-)