Posted By

adambundy on 10/15/11


php redirect wordpress

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


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('', 302); } ?>

Report this snippet  

You need to login to post a comment.