Support

Account

Home Forums General Issues Can I use a custom tax for a CPT permalink?

Helping

Can I use a custom tax for a CPT permalink?

  • Hello,

    I’d like a permalink structure like this for my custom post type: /%custom-tax%/news/

    Where %custom-tax% is the term for a custom taxonomy checked in the custom post.

    It’s like the core WordPress permalink where you can have the custom structure like /%category%/%postname%/

    Is it possible with ACF?

  • The standard WP permalinks for CPT and taxonomies is

    CPT
    archive = /$post_type/
    single = /$post_type/$post_name/

    Taxonomy
    archive /$taxonomy_name/$term_slug

    Anything outside of this is beyond the ability of ACF or any other plugin that manages custom post types that is available (as far as I know) to accomplish.

    The only way to do this is by adding custom rewrite rules and custom permalink structure using WP actions and filters. It is a complicated process and more than I can explain here. Even this is going to be limited because your superstructure and rewrite rules will need to supply WP with the post type, the taxonomy, the term and the post name in order for the main query to find the correct page.

    To do this you will need to look at some or all of the following:

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.