Show Taxonomy Child Terms (name and image) on Parent Term Page

You can try this. $parent_terms = get_terms( array( ‘taxonomy’ => ‘post_tag’, ‘hide_empty’ => false, ) ); foreach ( $parent_terms as $terms) { $term = get_terms(array( ‘taxonomy’ => ‘post_tag’, ‘hide_empty’ => false, ‘parent’ => $terms->term_id ) ); foreach ($term as $term_child){ $string .= ‘<li><a href=”‘ . get_term_link( $term_child->term_id ) . ‘”>’ . $term_child->name . ‘</a></li>’; } … Read more

See the process of creating a taxonomy and tell me where I made a mistake

You shouldn’t be doing this: $searchProductsByCategory = [ ‘posts_per_page’ => 1, ‘post_type’ => ‘product’, ‘ignore_sticky_posts’ => 1, ‘orderby’ => ‘id’, ‘tax_query’ => [ [ ‘taxonomy’ => ‘product_category’, ‘terms’ => get_queried_object_id() ] ] ]; $foundProducts = new WP_Query($searchProductsByCategory); The whole point of taxonomy-product_category.php is that posts for the current category have already been queried. This is … Read more

get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error

This is a PHP syntax error. You’re attempting to pass an array to get_terms() but haven’t used array() or [] to make it an array. This means that => is invalid here. The code should be: public function pggggo_list_of_terms() { $terms = get_terms( [ ‘taxonomy’ => [ ‘vehicle_safely_features’, ‘vehicle_exterior_features’, ‘vehicle_interior_features’, ‘vehicle_extras’, ], ] ); return … Read more

IF taxonomy archive is hierarchical THEN

Look at the docs (please read the docs) for is_taxonomy_hierarchical(). You need to tell it which taxonomy you’re checking: if ( is_taxonomy_hierarchical( ‘my_taxonomy_name’ ) ) { } If you’re template isn’t specific to a taxonomy, and you need to know which taxonomy you’re viewing, use get_queried_object() to figure it out (you were already told how … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)