• Resolved tomfatom

    (@tomfatom)


    Hi, I’ve searched in the forum but could not find an easy solution for this.
    I have a custom taxonomy, when I have multiple categories from that taxonomy I don’t want them to be displayed in alphabetical order but I want to use the “make primary” function and pick the primary category for each post.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I believe that “primary category” stuff comes from Yoast SEO, if I’m not mistaken. Otherwise, it sounds like you’re wanting to change how the terms are listed in the admin?

    Thread Starter tomfatom

    (@tomfatom)

    Yes I think it comes from Yoast, so it does not work with custom taxonomies? No it’s not a problem of listing, I want to be able to set a primary term when my post has multiple terms/categories. It is something you can do in the WP core posts, but not in the custom post types and their taxonomies.

    Nobody solved this problem in the past? Thanks

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    From what I’m seeing in their code, it should be getting potentially used with every taxonomy associated on the post type you’re editing a post for, and once you start adding more than 1 term from the taxonomy. One thing the code is checking for is if the taxonomy is hierarchical, which also allows for parent/child terms.

    So to help check and confirm, does your taxonomy have hierarchical set to true and does the SEO UI show up when you’ve selected 2 or more terms?

    Looks like utilization and usage of the term is going to be stored as post meta on a key that’s like this: _yoast_wpseo_primary_TAXONOMY_SLUG with TAXONOMY_SLUG being the actual slug you registered. For example mine that i just tested was _yoast_wpseo_primary_genre for the term ID of my set primary term from a Genre taxonomy.

    Thread Starter tomfatom

    (@tomfatom)

    Thanks Michael, it was simpler than expected… I just set hierarchical to true and achieved what I wanted! Thank you!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome. Let us know if you need anything else.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Taxonomy, set Primary’ is closed to new replies.