Gordon Smith
Gordon Smith

Reputation: 124

Wordpress Custom Post Types add Taxonomies/SubTaxonomies to URL

Hi StackOverflow Heroes -

I'm using CPT UI to manage my custom post types (that can change if needed). I'd like to be able to display posts within a custom post type in categories and subcategories in the URL.

Right now, if I create a post in my custom post type and assign it a taxonomy and a category and sub category within that taxonomy - it lists the URL as:

domainname.com/custom_post_type/post

I'm confused as to why it won't show the post like this (Clearly I don't understand custom post types / taxonomies well enough and look to you for some enlightenment):

domainname.com/custom_post_type/taxonomy/subtaxonomy/post

The end result has to be flexible - meaning, sometimes the post will end up in a taxonomy and sometimes in a subtaxonomy.

I would love to use a plugin that just solves it all, but have tried several and they don't seem to work.

Basically, I'd like my custom post types to work just like the built in blog feature seems to work as it does show the correct folder structure when putting posts in to categories/subcategories.

Here's the menu structure I'm trying to achieve (for clarification)

Products(Top level - no page)
-Category(page with content)
--SubCategory(page displaying posts)
---Single Post

Sometimes the structure might need to be like this:

Products(Top level - no page)
-Category(page with content)
--Single Post

I've been working at this for several hours, and searching high and low across the internet to find a solution, but haven't been able to find one that fits. I appreciate your help and suggestions!

Upvotes: 0

Views: 1324

Answers (1)

Junaid
Junaid

Reputation: 1300

While you're using CPT UI, I thought use of another plugin to extend the functionality is a better solution in your case.

Use Custom Post Type Permalinks and configure the permalink option as:

/%custom-taxonomy-slug%/%postname%/

Upvotes: 0

Related Questions