1

I am using CPT UI. I have created a post type 'books' and custom taxonomy 'book_categories'. I am also using Custom Post Type Permalinks plugin for custom url.

  • When I click books, url is http://novice.dev/books and I can list categories
  • When I click category, url is http://novice.dev/books/book_categories/my_story_books
  • While I click on a post, it is http://novice.dev/books/thirty-days-and-night

I have set the url structure like this using Custom Post Type Permalinks plugin.

http://novice.dev/%cpt%/%custom_taxonomy%/%post%/

I tried searching on the net but could not get anything so that I can force keep the bond/find the relation between CPT and Custom Taxonomy. I want to achieve the following-

  1. When I am at archive.php, I can query the custom taxonomy of that post type and hence list all the posts and url as /%CPT%/
  2. When I am in taxonomy.php, I can get the custom post type slug/name/id and list all the posts related to that category and url as /%CPT%/%CUSTOM_CATEGORY%/
  3. When I am in single.php, there should be CPT and category there and url as /%CPT%/%CUSTOM_CATEGORY%/%POST%/

Individual experiments are successful but I am getting no way or complete reference to maintain the relation between these three. I do not know where I am doing wrong.

Or should I move to core programming?

0

Collaborative efforts-

  • For http://novice.dev/books just create custom post type and check rewrite options so that it adds end points.
  • For http://novice.dev/books/book_categories/my_story_books, create custom taxonomy related with the post type and check the options for rewrite options.
  • http://novice.dev/books/thirty-days-and-night will be automatically when above two are done.

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.