Last active
August 29, 2015 13:57
-
-
Save kovshenin/9642666 to your computer and use it in GitHub Desktop.
Did you know that WordPress appends a /date/ prefix to date archives if you use %post_id% in the permalinks structure? I didn't.
This file contains hidden or 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 | |
/** | |
* Plugin Name: Fix my /date/ | |
*/ | |
function fix_my_date() { | |
global $wp_rewrite; | |
$wp_rewrite->date_structure = '%year%/%monthnum%/%day%'; | |
} | |
add_action( 'init', 'fix_my_date' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment