Ryan Rampersad
Thoughts, opinions, ideas and now links
  • About
  • Podcast
  • Links

Archives

Help Needed: Custom Permalinks with Custom Post Types & Taxonomies

I’ve been attmepting to setup WordPress installation these past few days to manage the Friday night podcasts. The design was easy enough since I’ve done that before but my stumbling point has been these custom post types, custom taxonomies and the rewrite rules that govern them all.

Help Needed with CPT and Rewrites

Here’s what I setup: there is a custom post type (CPT) for episode. So for each episode of a podcast, I add a new Episode. Now, I figure there will be more podcasts on the same installation in the future, so I made a custom taxonomy (CT) for podcast. So when I make a new series, I just make a taxonomy entry and set the episode to have that taxonomy. So that’s good so far.

My ideal URL permalink structure would be this: the-nexus.tv/{podcast-name}/{episode-name}/ where the {podcast-name} is the name of the podcast, like “On The Hill” and the episode-name is the post-name of the episode. An example of this would be: the-nexus.tv/on-the-hill/243/. Does that make sense?

Right now, episodes have permalinks like so: the-nexus.tv/episode/1/. This is instantly problematic: the /1/ name is taken up forever across all episodes and there is no mention of which podcast this episode belongs too. What I need is the name of the podcast to be apart of the episode slug so that multiple episodes can have the same post-name. Somehow, this does not sound entirely possible.

What have I tried? I attempted to follow Jonathan’s post about permalinks and post types, but I did not have much success with it. I have searched the WordPress forums. And Google.

So, I’m really not having any luck. I read a mailing list entry from Otto that explains that custom post types don’t really function within the rewrites of normal posts, but that didn’t make too much sense to me.

Any ideas?

© 2013 Ryan Rampersad.