Created
October 6, 2013 05:14
-
-
Save paulredmond/6849795 to your computer and use it in GitHub Desktop.
Custom author rewrite urls for 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 | |
// Custom author URI structure even if the site | |
// is configured to use a custom structure, ie: /my-prefix/%postname%/ | |
add_filter('init', function () { | |
global $wp_rewrite; | |
$wp_rewrite->author_structure = '/' . $wp_rewrite->author_base. '/%author%'; | |
// Only uncomment the flush_rules() method call if things are not working. | |
// After the rules are flushed (refresh page), this can be commented out again. | |
// $wp_rewrite->flush_rules(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can even set a custom author_base, ie: