function add_custom_rewrite_rules() { $rules = array( 'top' => array( '^event/([0-9]{4})/page/([0-9]+)/?' => 'index.php?post_type=event&year=$matches[1]&paged=$matches[2]', '^event/([0-9]{4})/?' => 'index.php?post_type=event&year=$matches[1]', ), 'bottom' => array( ) ); foreach ( $rules as $position => $position_rules ) { foreach ( $position_rules as $rule => $rewrite ) { add_rewrite_rule($rule, $
{{#tags}}- {{label}}
{{/tags}}