Return to Snippet

Revision: 38587
at April 14, 2011 16:41 by ddavidd


Updated Code
if(!is_user_logged_in() && $pagenow != 'wp-login.php') {
    wp_redirect( '/comingsoon.html', 302 );
}

Revision: 38586
at April 14, 2011 16:02 by ddavidd


Updated Code
if(!is_user_logged_in()) {
    wp_redirect( '/comingsoon.html', 302 );
}

Revision: 38585
at March 11, 2011 08:30 by ddavidd


Updated Code
if( !is_user_logged_in() ) { 
    echo '<script type="text/javascript">window.location = "comingsoon.html";</script>';
}

Revision: 38584
at March 11, 2011 08:29 by ddavidd


Updated Code
if( !is_user_logged_in() ) { 
    echo '<script type="text/javascript">window.location = "comingsoon.html";</script>';
  }

Revision: 38583
at January 5, 2011 13:40 by ddavidd


Initial Code
<?php
  if( !is_user_logged_in() ) { 
    echo '<script type="text/javascript">window.location = "comingsoon.html";</script>';
  }
?>

Initial URL

                                

Initial Description
Add this in the functions.php file, in your Wordpress theme.

Initial Title
Wordpress - redirect if you\'re not logged in

Initial Tags
redirect, wordpress

Initial Language
PHP