Yoast – Custom Taxonomy – primary category

I found this and it works. Shout out to WP Munchies! https://wpmunchies.com/display-primary-category-using-yoasts-make-primary-feature/ <?php // Fill in your custom taxonomy here $yourTaxonomy = ‘CUSTOM_TAXONOMY’; // SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY $category = get_the_terms( $postId, $yourTaxonomy ); $useCatLink = true; // If post has a category assigned. if ($category){ $category_display = ”; $category_link = ”; … Read more

How to Implement Custom Taxonomy Conditional Page?

For custom taxonomy template you can create a php file in your child theme with name “taxonomy-[taxname].php for example taxonomy-laptops.php. This template will be use for any post type that contains taxonomy laptops. In taxonomy-laptops.php you could use a condtional like if post type is laptops then do something else something else. I hope this … Read more

Create new Taxonomy, add extra fields, register terms AND extra fields values?

In your cases “wp_insert_term” does not save extra custom fields. Please try with below code : foreach ( $this->terms as $term_key=>$term) { // insert new terms in taxonomy wp_insert_term( $term[‘name’], $this->taxonomy, array( ‘slug’ => $term[‘slug’], ‘description’ => $term[‘description’] ) ); update_option( ‘term_team_code_’ . $term[‘slug’], $term[‘code’] ); update_option( ‘term_team_nba_id_’ . $term[‘slug’], $term[‘nba-id’] ); update_option( ‘term_team_espn_id_’ . … Read more