Skip to content

Instantly share code, notes, and snippets.

@slaFFik
Last active October 9, 2015 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaFFik/3491627 to your computer and use it in GitHub Desktop.
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]
<?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