how to show all categories by get_terms

The reason it’s only getting parents is this part: parent=0 This queries categories that don’t have a parent, so you only get the top level. Remove it and you’ll get all categories: get_terms(‘category’,’hide_empty=false’) That being said, you’d be better off using wp_dropdown_categories(). That way you will get the proper ordering and indentation of child categories: … Read more

How to use germ_terms() with meta_query for ACF Taxonomy field?

Answer – the correct formulation is… ‘meta_query’ => array( array( ‘key’ => ‘Topic’, ‘value’ => “12057”, ‘compare’ => ‘LIKE’ ) ) In full: ` $args = array( ‘taxonomy’ => ‘event’, // ‘order’ => ‘ASC’, ‘hide_empty’ => false, ‘hierarchical’ => true, // ‘parent’ => 0, ‘meta_query’ => array( array( ‘key’ => ‘Topic’, ‘value’ => “12057”, ‘compare’ … 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

How to display Woocommerce products list by tag

Finally Solved my problem My previous code was only for category wise product but when using tag it should be post. for better explain someone can please explain about the whole process. <?php $args = array( ‘number’ => $number, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘hide_empty’ => $hide_empty, ‘include’ => $ids ); $product_tags = get_terms( … Read more