Thread Starter
rs200
(@rs200)
yes I re-saved the permalink settings. I also activated the $wp_rewrite->flush_rules(); within my rewrite function. After I’ve done this, /events/2013/10 and /events/2013/ works but I got a 404 for /events/2013/10/entry1. When I re-saved the permalink settings, where the ‘custom post types permalinks’ plugin allows me to set the permalink for events to events/%year%/%monthnum%/%postname%/, the entry the monthly list is working but not for the year.
function my_rewrite() {
global $wp_rewrite;
// $wp_rewrite->add_permastruct('events', '/events/%year%/%monthnum%/%postname%/', False, 1);
add_rewrite_rule('events/([0-9]{4})/?$', 'index.php?post_type=events&year=$matches[1]', 'top');
add_rewrite_rule('events/([0-9]{4})/([0-9]{2})/?$', 'index.php?post_type=events&year=$matches[1]&monthnum=$matches[2]', 'top');
// $wp_rewrite->flush_rules(); // !!!
}
maybe I should disable the plugin and set all permalinks and rewrites manually?
And yes there is a closing / at the end. But it doesn’t matter if I browse with or without /.