View the complete list of a taxonomy in the navigation menu

You can achieve the result using following code: $terms = get_terms( array( ‘taxonomy’ => ‘country’, ‘hide_empty’ => false, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ) ); if ( !empty($terms) ) : $output=”<ul>”; foreach( $terms as $country ) { $output.= ‘<li><a href=”‘.get_term_link( $country->term_id ).'”>’. esc_attr( $country->name ) .'</a></li>’; } $output.='</ul>’; echo $output; endif; Here I’m using … Read more

Clear Terms from Taxonomy for Specific Post IDs?

So if you’re sure you want to delete the actual term as well as the relationship that assigns the term to the post, this will do it (tested and works for me): delete term from wpterm_taxonomy term, wpterm_relationships rel where term.term_taxonomy_id = rel.term_taxonomy_id and rel.object_id IN (1) ; And obviously replace the ‘1’ there with … Read more

How to display a value inside a post with a specified category from a category custom field? [closed]

You can use get_the_category() to get the categories assigned to a specific post and use the_field() or get_field() to display/get the value of a specific ACF field. (You can also use get_term_meta() in place of get_field()) So for example, the following will display a simple list of the categories (and I really mean plain simple), … Read more

How to give each category name its own ACF background color?

The syntax to get the ACF field of a custom taxonomy is: $var = get_field(‘name_of_acf_field’, ‘name_of_taxonomy’ . ‘_’ . taxonomy_ID); so in your case you’ll need to get product_cat ID before and do something like: add_action( ‘woocommerce_shop_loop_item_title’, ‘VS_woo_loop_product_title’, 10 ); function VS_woo_loop_product_title() { echo ‘<h3>’ . get_the_title() . ‘</h3>’; $terms = get_the_terms( $post->ID, ‘product_cat’ ); … Read more

Show Taxonomies with admin area for custom post type?

As documented, you can set the show_admin_column argument of register_taxonomy() to true to do this: ‘show_admin_column’ (bool) Whether to display a column for the taxonomy on its post type listing screens. Default false. For example: register_taxonomy( ‘subject’, // The name of the taxonomy. Name should be in slug form (must not contain capital letters or … Read more