list all post who have mutual taxonomy as current taxonomy!

No custom programming answer: A plugin like https://facetwp.com/ will allow you to set up filters as you have described. Custom programming answer: You can create a shortcode that renders fields for the user to check and submit. Then, attach a javascript submit handler to the form so that when the user checks a box or … Read more

Select multiple categories with is_tax

Thanks to @SallyCJ for the correct answer — you can supply an array of category IDs/slugs/names to is_tax() to check for multiple categories. Here is the correct code: /* Hyde out of stock product specific category */ add_filter( ‘pre_get_posts’, ‘hide_out_of_stock_from_cat’ ); function hide_out_of_stock_from_cat( $query ) { if ( $query->is_tax( ‘product_cat’, array( 15, 16, 18, 19, … Read more

Sort by an ACF field in a tax_query

You have placed orderby in a wrong array. Please check modified code. $loop = new WP_Query( array( ‘post_type’ => ‘partenaires’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1, ‘paged’ => $paged, ‘meta_key’=> ‘partners_order’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘type_partenaires’, ‘field’ => ‘ID’, ‘terms’ => $term->term_id ), ), … Read more

how do you pull data from two taxonomies?

First, get all term slugs from the custom example taxonomy space by current post ID. $space_terms = wp_get_post_terms( $post->ID, ‘space’ ); if( $space_terms ) { $space_terms = array(); foreach( $space_terms as $term ) { $space_terms[] = $term->slug; } } You should specify the logical relationship between each inner taxonomy array when there is more than … Read more

How to search through all child taxonomies using WP_Query?

Finally figured out the solution. Answering it if anyone finds it useful. Where $_GET[‘s_qr’] has a search query from a user from another page. $i = 0; $parent_name=””; $taxonomyName = “product-cat”; $search_r = array(); $parent_terms = get_terms( $taxonomyName, array( ‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false ) ); foreach ( $parent_terms as $pterm … Read more

tax_query will produce nothing

Looking at the WP_Query documentation on tax_queries we can see it accepts a nested array as a parameter. Compare that to the provided code: ‘tax_query’ => array( ‘taxonomy’ => ‘news_category’, ‘field’ => ‘term_id’, ‘terms’ => 82, ), Should look like: ‘tax_query’ => [ [ ‘taxonomy’ => ‘news_category’, ‘field’ => ‘term_id’, ‘terms’ => 82, ] ],

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