• We have custom post type and custom taxonomy for that custom post type. We have problem with url rewriting.
    Current url structure is:
    [ redundant link removed ]

    Term “proizvodi” is custom post type
    Term “kategorija_proizvoda” is custom taxonomy slug
    Term “opsta-rasveta” is name of the custom taxonomy

    We need url structure like this:
    /sr/proizvodi/opsta-rasveta/

    Custom post type is made with CPT UI plugin with newest version 1.6.2 and wordpress version 5.2.4

    We tried using CPT UI’s Custom Rewrite Slug option, we could remove the custom taxonomy slug with “/”, but it redirect to 404 error page.

    We tried plugin Remove Taxonomy Base, it removed from url but also is showing error page 404.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The rewrite slugs declared with custom objects has some limitations. You can create arbitrary permastructs with add_rewrite_rule(), but you must plan carefully. If there is any ambiguity, something or another will fail to work as desired. Using a CPT slug as part of a taxonomy URL could be problematic because WP will try to query for post types and not taxonomy terms. It’s better to not use it or use a synonym so WP does not get confused.

    Your explanation of terms is not clear to me. CPT I get. Which is the taxonomy name slug and which is that taxonomy’s term slug? I’m assuming kategorija_proizvoda is the taxonomy and is its term that is assigned to certain CPT posts. If so, what I said above is correct.

    Thread Starter markostancic

    (@markostancic)

    Thank you for your reply.

    Taxonomy name is “kategorija_proizvoda”, and Taxonomy term is “opsta-rasveta”

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

The topic ‘Custom post type rewrites url structure’ is closed to new replies.