Last active
October 9, 2015 10:47
-
-
Save slaFFik/3491627 to your computer and use it in GitHub Desktop.
Redirect users from a home page to any page if logged in [WordPress]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'template_redirect', 'redirect_visitors' ); | |
function redirect_visitors() { | |
if( is_user_logged_in() && (is_front_page() || is_home())) { | |
wp_redirect('http://ab.ovi/test2'); | |
exit; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment