I have created a custom post type bl_properties.
I have created a taxonomy city.
Now I want my city archive page url will be like: example.com/custom-string/city/city-name/
Register Post type:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'capability_type' => 'post',
'taxonomies' => array( 'status', 'city', 'asset_type', 'appt_type' ),
'has_archive' => true,
'hierarchical' => true,
'menu_position' => 4,
'supports' => array( 'title', 'editor', 'author' ),
'rewrite' => array('slug' => 'custom-string')
);
Register Taxonomy:
register_taxonomy('city',array('bl_properties'), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_in_rest' => true,
'show_admin_column' => true,
'has_archive' => true,
'query_var' => true
));
I have tried with category based permalink from WP-ADMIN area but not working for mu post type.
New contributor
Deepak Saini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.