I have a custom post type registered as follows:
register_post_type( 'gs_business_listings',
array(
'labels' => array(
'name' => __( 'Local Businesses' ),
'singular_name' => __( 'Local Businesses' )
),
'public' => true,
'taxonomies' => array( 'category', 'gs_business_listing_region' ),
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail', 'revisions'),
'register_meta_box_cb' => array($this,'add_meta_boxes'),
'rewrite' => array('slug'=> apply_filters('goosesoft-coupons-archive-url', 'local-businesses'))
)
);
and for this custom post type I have a custom taxonomy which is registered as follows:
register_taxonomy(
'gs_business_listing_region',
'gs_business_listings',
array(
'labels' => array(
'name' => 'Regions',
'singular_name' => 'Region',
),
'rewrite' => array( 'slug' => 'region', 'hierarchical' => true ),
'hierarchical' => true,
'has_archive' => true,
)
);
This works on the admin side. Everything is as expected. Regions
shows in the Local Businesses
submenu. I can save the Regions for a specific post.
But permalinks are not working for the taxonomies. What I need seems pretty straight forward and would be what I expect default behavior to be.
I need the taxonomy url to be www.example.com/region/a-region
where a-region
is one of the taxonomies. But when I go to a url like that it does not work. More puzzling is that get_term_link()
returns a url in exactly that format, but I get a 404 error on the very link that returns.
What could I be missing?