Skip to content

Instantly share code, notes, and snippets.

@macariojames

macariojames/header.php

Last active Sep 1, 2019
Embed
What would you like to do?
WordPress redirect non-logged in user to a page/site
<?php
// put this in header.php
if (!is_user_logged_in()) {
wp_redirect( 'https://www.yourdomain.com');
exit;
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.