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.
|
|
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. |
|||
|
|
@supertrue I can't comment so i post it as answer. Have you find a solution for the second situation to use the same taxonomy for a second custom post type (in your example CPT reviews)? |
|||
|
|