I have CPT called 'Jobs'.
The jobs are posted in the following URL
siteurl/jobs/job-slug
I will be posting jobs of different categories and would like to change the URL based on job type taxonomy.
For example.
siteurl/jobs/product-management/job-slug1
siteurl/jobs/project-management/job-slug2
siteurl/jobs/marketing/job-slug3
How can I achieve this?
I would also like to create category pages for each job type that only shows jobs of that category ---
For example.
siteurl/jobs/product-management/
siteurl/jobs/project-management/
siteurl/jobs/marketing/
How can I achieve this?
Hello,
No, there isn't such kind of built-in features within Toolset Types plugin or WordPress core.
1) Toolset Types plugin is using WordPress built-in function register_post_type() to create post types, see WP document:
https://developer.wordpress.org/reference/functions/register_post_type/#rewrite
You can not change the custom post type URL based on other taxonomy.
2) Toolset Types plugin is using WordPress built-in function register_taxonomy() to create taxonomies, in your case, it needs to setup same rewrite rule "jobs" as the custom post types, it will conducts unexpected result:
The same value is already used in permalink rewrite rules for the custom post type "jobs". Using it again can cause issues with permalinks.
So in my opinion, even it is possible with custom codes, but it is not recommended to setup the permalinks as you requested above.
What if I do this
1. Create a job post called Product Management -- let us call it Post V1
2. Make is the parent post to all jobs that are related to product management
3. Create a new custom template for product management job i.e. Post V1
4. In the custom template, only show jobs from product management
This way the URL will change to
siteurl/jobs/product-management/job-slug1
and the siteurl/jobs/product-management/
custom post will be used as a category page.
Do you see issues with this?
Yes, you are right, it should be possible with a hierarchical custom post type "jobs":
https://developer.wordpress.org/reference/functions/register_post_type/#hierarchical
You will get the URL links as you mentioned above.
My issue is resolved now. Thank you!