I did little tweak for date archive permalink.
function my_rewrite_rules($wp_rewrite){
$rules = array();
$rules['news/([0-9]{4})/?$'] = 'index.php?year=$matches[1]';
$wp_rewrite->rules = $rules + $wp_rewrite->rules;
}
add_action('generate_rewrite_rules', 'my_rewrite_rules');
Then hit the url below.
http://blahblah.blahblah/wp/news/2017/
This successfully shows posts belong to 2017.
Now I want to generate the links for date archive, but this doesn’t generate the code I want.
get_year_link($year);
Still generate the default permalink like this:
http://blahblah.blahblah/wp/date/2017/
So how do I tell wordpress what permastructure to use?
Otherwise I may have to hard code…