Home › Forums › General Issues › how to add category slug to permalink › Reply To: how to add category slug to permalink
Yes, this is doable, but it requires a bit more than ACF alone. First, your custom post type needs to be registered with a custom rewrite slug that includes a placeholder, for example project/%project_category%. Then you hook into post_type_link to dynamically replace that placeholder with the actual taxonomy term slug assigned to the post. You’ll also need to flush rewrite rules once (by resaving permalinks). ACF only stores the taxonomy selection; WordPress rewrite rules handle the URL logic. As long as each project has one primary taxonomy term, this approach works reliably.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.