How to give a CPT (custom post type) a date based url
Assuming that your event rewrite slug is event and you want your datebased URLs to look like: http://domain.com/event/2011-06-14/ function custom_permalink_for_my_cpt( $rules ) { $custom_rules = array(); // a rewrite rule to add our custom date based urls $custom_rules[‘event/([0-9]{4}-[0-9]{2}-[0-9]{2})/?$’] = ‘index.php?post_type=event&event-date=$matches[1]’; return $custom_rules + $rules; } add_filter( ‘rewrite_rules_array’, ‘custom_permalink_for_my_cpt’ ); // add a query var so … Read more