• Resolved jordash56

    (@jordash56)


    I created a Custom Post type and in that custom post type have a hierarchical taxonomy (categories).

    Here’s an example of the categories I made:

    Hats
    – Mens
    – Womens

    Shoes
    – Mens
    – Womens

    The problem is that when I go to the “Mens” sub-category of the “Shoes” Main category it goes to the Mens category of the “Hats” category, i’m guessing it’s because the permalink URL of the two is the same. (though this still happens even without permalinks customized)

    What is the best way around this problem?

Viewing 1 replies (of 1 total)
  • Thread Starter jordash56

    (@jordash56)

    I discovered I was getting the term links by the name rather than the slug or id.

    I changed this:

    get_term_link( $term->name, $taxonomyName );

    to this:

    get_term_link( $term->slug, $taxonomyName );

    And it worked perfectly.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Hierarchal Taxonomy Sub-Categories of Same name go to incorrect pages’ is closed to new replies.