using pages instead of archive for custom post types, rewrite permalink

Question

I have a custom post type registered as “cpt_projects”. I’m rewriting the slug as:

'rewrite' => array( 'slug' => 'our-work/%custom_cat%', 'with_front' => true ), 
'has_archive'=> false,

I’m wanting to use a page called “our-work” instead of the archive, but then I run into the page/archive name (permalink) conflict.

So I change the page name to “work” and get:

work/education” (education being a category and a page name) YAY. This is showing the page and child page in the URL

But then when I click on a single project link, I get:

our-work/education/project-name” – PROBLEM: if you remove “project-name” then it doesn’t display the “education” page, remove “education” and it doesn’t display the “work” page.

I’m looking for a solution that can rewrite the URL so that it displays the page name “work” instead of “our-work”.

0
David Klotz 3 weeks 2023-05-14T13:21:51-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse