I have registered a custom post type city
with 2 taxonomies city_categories
and cities
. But wordpress is taking archive.php instead of archive-city.php, don't understand where am I mistaking. It works only if I create a taxonomy-cities.php and then is taking taxonomies-cities.php. How can I make it take directly archive-city.php
register_post_type( 'city',
array(
'labels' =>
array(
'name' => 'City Guides',
'singular_name' => 'City Guides',
'add_new' => 'Add New',
'add_new_item' => 'Add New retailer',
'edit' => 'Edit',
'edit_item' => 'Edit retailer',
'new_item' => 'New retailer',
'view' => 'View',
'view_item' => 'View retailer',
'search_items' => 'Search retailers',
'not_found' => 'No retailer found',
'not_found_in_trash' => 'No Shop retailer in Trash',
'parent' => 'Parent retailer'
),
'public' => true,
'menu_position' => 6,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'has_archive' => true,
'taxonomies' => array('city_categories'),
'can_export' => true,
'rewrite' => array('slug'=>'travel')
)
);
$args = array(
'labels' => $labels, // defined correctly, shortened the code
'public' => true,
'show_in_nav_menus' => true,
'show_ui' => true,
'show_tagcloud' => true,
'show_admin_column' => true,
'hierarchical' => true,
'rewrite' => true,
'query_var' => true
);
register_taxonomy( 'city_categories', array('city'), $args );
$args = array(
'labels' => $labels, // defined correctly, shortened the code
'public' => true,
'show_in_nav_menus' => true,
'show_ui' => true,
'show_tagcloud' => true,
'show_admin_column' => true,
'hierarchical' => true,
'rewrite' => true,
'query_var' => true,
'sort' => true
);
register_taxonomy( 'cities', array('city'), $args );