How do I display the grand child items of a taxonomy term?

I managed to answer this question myself by adding get_queried_object()->term_id; instead of the taxonomy terms ID. It now outputs all the grandchild taxonomy terms for the current taxonomy term. Here is my updated working code: $term_id = get_queried_object()->term_id; $taxonomy_name=”product_range”; $term_children = get_term_children( $term_id, $taxonomy_name ); echo ‘<ul>’; foreach ( $term_children as $child ) { $term … Read more

Tax query AND/OR meta query [duplicate]

It’s not possible without a more custom query/filter. I have achieved it with a filter (code taken from this guy on this gist – https://gist.github.com/elvismdev/61f8509eff8abcc21ef84154b74fbf56) function f1_egpaf_meta_or_tax( $where, \WP_Query $q ) { // Get query vars. $tax_args = isset( $q->query_vars[‘tax_query’] ) ? $q->query_vars[‘tax_query’] : null; $meta_args = isset( $q->query_vars[‘meta_query’] ) ? $q->query_vars[‘meta_query’] : null; $meta_or_tax … Read more

Retrieve Custom Taxonomies according to posts selected

The loop for $listings should include a call to $listings->the_post() so that the global post object is assigned to the current listing in the loop: while ( $listings->have_posts() ) { /*** Add the following line: ***/ $listings->the_post(); $post_get = get_the_ID(); $term_get = get_the_terms($post_get, ‘Car_Series’); $term_array = $term_get; print_r($term_get); array_push( $term_array, $term_get); } Without this, functions … Read more

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