I am struggeling in getting the URL for a new CPT "Projects" to be domain.com/categories/post-title.
It stays at domain.com/custom-post-type/post-title, I can't even get it to /custom-post-type/category/post-title which I managed on another website, except I need to drop custom-post-type from the url here to avoid having to create too many url redirects for existing pages.
- CPT option URL rewrite is checked and uses the normal WP logic
- checked and unchecked "Allow permalinks to be prepended with front base", doesn't make a difference.
- have set permalink to "/%category%/%postname%/", doesn't make a difference. Set it even to "/test/%category%/%postname%/", again, no difference.
Hi,
Thank you for contacting us and I'd be happy to assist.
To achieve a permalink structure like this for your custom post type, you'll either have to use a third-party plugin or add custom code for the custom rewrite rule.
Here are some useful resources on the topic:
https://wordpress.org/plugins/custom-post-type-permalinks/
https://wordpress.stackexchange.com/questions/39500/how-to-create-a-permalink-structure-with-custom-taxonomies-and-custom-post-types
regards,
Waqar
would an url like domain.com/custom-post-type/category/post-title work without the extra code/plugin?
Thanks for writing back.
I've performed some testing and research and can confirm that you'll need to include custom code or a third-party plugin to add a category/taxonomy term slug in the URL of the custom post types.
Note: It is possible to set the '/%category%/%postname%/' custom structure through WP Admin -> Settings -> Permalinks, but that is applied only to the regular posts, not the custom post types.
Thank you.
Too bad this is not an option in Toolset, where granular URL control is much needed.