How to show post which has the specific taxonomy terms?

Use this code instead. $terms = wp_get_post_terms( $post->ID, array(‘competition’, ‘session’) ); $term_slugs = wp_list_pluck( $terms, ‘slug’ ); $season = wp_get_post_terms( $post->ID, ‘session’ ); $season_slugs = wp_list_pluck( $terms, ‘slug’ ); $args = array( ‘post_type’ => array( ‘football_fixture’ ), // profile and letter are CPTs ‘tax_query’ => array( array( ‘taxonomy’ => ‘competition’, ‘field’ => ‘slug’, ‘terms’ => … Read more

WordPress Multiple Taxonomy Query

Perhaps you can add a hidden field to the HTML which will pass the ‘relation’ => ‘OR’. <input type=”hidden” name=”tax_query[relation]” value=”OR”> <select name=”tax_query[][country]” multiple> <option value=”united-kingdom”>United Kingdom</option> <option value=”ireland”>Ireland</option> </select> <select name=”tax_query[][type]” multiple> <option value=”director”>Director</option> <option value=”partner”>Partner</option> </select> Which translates to: tax_query[relation]=OR&tax_query[][country]=united-kingdom&tax_query[][type]=director Array ( [tax_query] => Array ( [relation] => OR [0] => Array ( … Read more

In Product Category archives how to show Posts having same/similar prod_cat slug structure?

Here I’ve written a function for you- function the_dramatist_get_product_cat_posts( $args = array() ) { $default_args = array( ‘taxonomy’ => ‘product_cat’, ‘get_post_type’ => ‘post’ ); $t = array(); $param = wp_parse_args($args, $default_args); $prod_terms = get_the_terms(get_the_ID(), $param[‘taxonomy’]); foreach ($prod_terms as $prod_term ) { $t[] = $prod_term->term_id; } $posts = get_posts(array( ‘post_type’ => $param[‘get_post_type’], ‘numberposts’ => -1, ‘tax_query’ … Read more

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