I have created a WP stack with 3 post types:

 1. Post (default)
 2. Event
 3. Place

These 3 post types share the same taxonomy, that being the default WP category, here are some example categories:

 1. Shopping
 2. Concerts
 3. Sports

I need to create a category archive for each of the post types:

eg. http://example.com/event/concerts  /* cat = concerts, post_type = event */
eg. http://example.com/post/concerts   /* cat = concerts, post_type = post */
eg. http://examplecom/place/shopping   /* cat = shopping, post_type = place */

However, I'm not sure how to go about with this... would creating individual template files like category-event.php, category-place.php and category-post.php work?

In which case, would I have to do a custom WP Query with the relevant $args or does the query come from the URL?

I'm not even sure of how to create a link to the page. I've tried /event/concerts/ and /event/category/concerts/ - in both scenarios I get a 404 error, not even an empty loop.

Any advice?


Your categories are, shopping , concerts and sports. So in order to create a category archive, you should follow category-{category-slug}.php Hence your file name should be : category-shopping.php category-sports.php category-concerts.php. And after this try with /event/category/concerts/ - this will solve your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.