How to modify the slug for custom post type and custom taxonomy
- This topic has 3 replies, 2 voices, and was last updated 2 years, 1 month ago by
Peter.
-
AuthorPosts
-
September 21, 2023 at 10:21 PM #43315
Johnson
ParticipantI have the page for all service details. The page slug is /our-services.
So, the URL is http://www.mywebsite.com/our-services===================
I also created a custom post type for the single service page. The slug is /service.
So, the URL for each single service page is:
http://www.mywebsite.com/service/single-service-1
http://www.mywebsite.com/service/single-service-2But when I type the URL http://www.mywebsite.com/service/. It goes 404 pages.
How can I use the slug as the all-service details page? (/our-services)
So, the URL for a single service page will be like this:
http://www.mywebsite.com/our-services/single-service-1
http://www.mywebsite.com/our-services/single-service-2===================
I also created a custom taxonomy for the service category. The slug is /service-category
So, the URL for each single service category page is:
http://www.mywebsite.com/service-category/single-service-category-1
http://www.mywebsite.com/service-category/single-service-category-2But when I type the URL http://www.mywebsite.com/service-category/. It goes 404 pages.
How can I use the slug as the all-service details page? (/our-services)
So, the URL for a single service page will be like this:
http://www.mywebsite.com/our-services/single-service-category-1
http://www.mywebsite.com/our-services/single-service-category-2September 21, 2023 at 10:31 PM #43316Johnson
ParticipantI already put the slug "our-services" in the "Custom rewrite slug" field on both custom post type and custom taxonomy.
But it doesn't work with Bricks Builder's Template. I use Bricks Builder and I built 2 templates, one for the service category pages(taxonomy) and another one for single service pages(custom post type).
September 22, 2023 at 1:49 AM #43318Johnson
ParticipantThe single service page (custom post type) is working. I have set the "Custom rewrite slug" field and the "Custom archive slug" field to "our-service". And build the template for the Service. It works.
So, for the single service page (custom post type) problem is solved.The service category (taxonomy) still doesn't work. I have set the "Custom rewrite slug" field to "our-service". It doesn't work, but when I set the "Custom rewrite slug" field to other than "our-service", it works. How to fix this problem? 🙂
September 23, 2023 at 11:08 AM #43331Peter
ModeratorHello,
It might not work because the slug "our-service" is already used by the CPT and could lead to a conflicting slug issue. You should use a unique slug for the taxonomy and the single page. For example:
our-service-taxonomy,our-service-page. -
AuthorPosts
- You must be logged in to reply to this topic.