Custom field and category query

For multiple category handling you need either category__in or a tax_query, for multiple custom fields you use meta_query. The various options for both of these are covered in the WP_Query codex page. $args = array( ‘posts_per_page’ => 10, ‘category__in’ => array( 163, 165 ), ‘meta_query’ => array( array( ‘key’ => ‘a_field’, ‘value’ => array( 1, … Read more

WP Query between posts custom fields [duplicate]

Problem solved, I’ve used this: $d=new WP_Query( array( ‘category__in’ => array(4), ‘post_type’ => ‘post’, ‘posts_per_page’ => ‘-1’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘data’, ‘value’ => $t, ‘compare’ => ‘<=’ ), array( ‘key’ => ‘data’, ‘value’ => $o, ‘compare’ => ‘>=’ ) ), ) ); Instead … Read more

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