Is there any way to add %post_type% and %taxonomy% to permalinks? I want to have links from one custom post type have one taxonomy’s terms in its permalink, and another post type to use another taxonomy’s terms.
Leave a Reply
You must be logged in to post a comment.
I will try to answer the question in detailed but keeping it as short as possible considering you have achieved the basics.
Suppose our custom post type one is to be connected to taxonomy one.
Let’s call them ‘console'(custom post type) and ‘brands'(taxonomy).
You want to achieve:
http://example.com/console/brands/sony/
Steps:
Register the taxonomy first and attach it to custom post type console.
Step Two:
Now create the custom post type.I’m not writing the whole code but remember the important parameter here is the ‘rewrite’
visit your Settings > Permalinks options screen in the WordPress admin to ensure your new permalinks are picked up
Repeat the steps for second custom post type and taxonomy 2.:)cheers..
PS:You need to define has_archive key to have archive page.