Last active
April 11, 2016 23:22
-
-
Save hauge75/0dda5b75d1288bb4259f28a783eae115 to your computer and use it in GitHub Desktop.
Redirects wordpress author archives
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 | |
//Redirects author archives, DON'T check "Disable Extra User Archives" in iThemes security | |
add_action( 'template_redirect', 'my_redirect_author_archive' ); | |
function my_redirect_author_archive() { | |
if ( is_author() ) { | |
wp_redirect( home_url(), 302 ); | |
exit; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment