Created
September 28, 2014 16:16
-
-
Save deryckoe/2dd626632895d2fab874 to your computer and use it in GitHub Desktop.
Redirect if no admin - 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
function under_construcction() { | |
if ( ! is_page('login') ) { | |
if ( ! is_user_logged_in() ) { | |
wp_redirect( '/en-construccion/', 301 ); // o puedes redireccionar a una página dentro de WordPress, utilizando get_permalink(); | |
exit; | |
} | |
} | |
} | |
add_action( 'template_redirect', 'under_construcction' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment