Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've got a Custom Post Type with a Custom Taxonomy set up. So how do I create an archive template to display posts from that CPT, limited by taxonomy?

Here's the deal:

The CPT is called Shows. Each post represents an upcoming concert. Its archive page lives at mysite.com/shows.

The taxonomy is called Bands. Each Show post is tagged with the Band performing the concert.

What I want is to create an archive page to display all Show posts tagged with a certain band.

For example, I want the visitor to be able to open mysite.com/shows/radiohead, and see all of the Shows posts tagged with "Radiohead" in the Bands taxonomy.

How do I publish a template that will support that URL structure?

Thanks for any help you can provide.

share|improve this question

1 Answer 1

Having Shows as a shared slug for your post type and taxonomy never end well, And you will not be able to do this using WP_Rewrite alone, since it can't distinguish between term slugs and post slugs.

take a look at this similar question which has a few solutions but the suggestion is to use a different slugs post types and taxonomies.

share|improve this answer
    
Thanks - I may not have explained this well. My CPT is "Shows," with a slug of "shows." The taxonomy is called "Bands," with a slug of "bands." What I want is to be able to display an archive of posts from the "Shows" CPT that are tagged with a term from the "Bands" taxonomy. Ideally, the URL structure should be mysite.com/shows/radiohead, where "shows" represents the slug of the CPT, and "radiohead" represents the slug of designated term from the "Bands" taxonomy. I'd appreciate any insight as to how to make that happen. –  DreadfulFlight Aug 21 '12 at 18:02
    
That's is what is got from your question and that's called sharing a slug. –  Bainternet Aug 22 '12 at 5:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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