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?
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
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.
Thanks Michael, it was simpler than expected… I just set hierarchical to true and achieved what I wanted! Thank you!
Awesome. Let us know if you need anything else.