I have a custom post type called “services” with a category called “service_areas” and want to be able to pull up a page listing all of the “service_areas”. I’m not exactly sure what this page would be called, because I believe that a “category archive page” would be a page listing all of the posts from a specific one of the “service_areas”s.
Calling the url
domain-name.com/service_areas/a_service_category pulls up a category archive page for the
a_service_category category as expected.
What is a good way to make
domain-name.com/service_areas pull up a page listing all of the “service_areas” (as opposed to a 404)?
I noticed that if I filter ‘pre_get_posts’,
$query->query['name'] == 'service_areas' is true for that url. Possibly I could load a custom template based on that test and loop through
get_terms( 'service_areas' ), but I’m not sure how.
Read more here: Page listing all categories for CPT