Posted By

adambundy on 10/15/11


Tagged

php redirect wordpress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

adambundy


Wordpress redirect non-logged-in visitors


 / Published in: PHP
 

Place at the top of your header.php to redirect visitors who are not logged-in to the Wordpress admin. I use this to redirect to a simple HTML 'coming soon' page while sites are in development.

  1. <?php if (!is_user_logged_in()) { wp_redirect('http://mydomain.com/coming-soon.html', 302); } ?>

Report this snippet  

You need to login to post a comment.