In my plugin I have a custom post type with a slug of 'ready-to-wear' and I have a custom taxonomy called 'seasons' associated with it.
The odd thing is that this url with query works:
http://dev.catwalkyourself.com/ready-to-wear/?seasons=autumn-winter-2012-2013-en
but the same one with custom permalink doesn't:
http://dev.catwalkyourself.com/ready-to-wear/seasons/autumn-winter-2012-2013-en
It throws a 404 error. You can try pasting the links yourself.
Here is my relevant plugin code:
Here is where the custom post type is registered
$post_types = array();
$post_types['rtw'] = $args = array(
'labels' => array(
'name' => __('RTW Collections'),
'singular_name' => __('Ready to Wear Collection'),
'add_new' => __('Add new RTW collection'),
'add_new_item' => __('Add a new show to the RTW collection'),
'edit_item' => __('Edit Collection'),
'view_item' => __('View Collection'),
'search_items' => __('Search Ready to Wear Collections'),
'not_found' => __('No RTW Collections found'),
'not_found_in_trash' => __('No RTW Collections found in trash')
),
'query_var' => 'rtw_collections',
'supports' => array('title', 'editor', 'thumbnail', 'author', 'comments'),
'has_archive' => true,
'publicly_queryable' => true,
'show_ui' => true,
'taxonomies' => array('seasons','city'),
'rewrite' => array(
'slug' => 'ready-to-wear',
'with_front' => false
),
'public' => true,
'menu_position' => 6
);
Here is where the taxonomy is configured:
$taxonomies = array();
$taxonomies['seasons'] = array(
'query_var' => 'seasons',
'rewrite' => array(
'slug' => 'seasons',
'with_front' => false
),
'single_value' => true,
'required' => true,
'labels' => array(
'name' => __('Seasons'),
'singular_name' => __('Season'),
'edit_item' => __('Edit Season'),
'update_item' => __('Update Season'),
'add_or_remove_items' => __('Add or remove seasons'),
'new_item_name' => __('Add new Season'),
'all_items' => __('All Seasons'),
'search_items' => __('Search Seasons'),
'popular_items' => __('Popular Seasons'),
'separate_items_with_commas' => __('Separate Items with commas'),
'choose_from_most_used' => __('Choose from most used Seasons')
)
);
and here is the call to register_taxonomy
:
foreach ($taxonomies as $taxonomy => $arr) {
register_taxonomy($taxonomy, null, $arr);
}
I have tried:
- Flushing the permalinks repeatedly
- Setting 'with_front' true and false repeatedly
- add flush_rewrite action to my functions.php
Unfortunately, none of these work. Please help me out.