WP_User_Query with combined meta query – not working?

It looks like you’re using wrong parameters, please try this instead (untested): $q = new WP_User_Query( array( ‘role’ => ‘contributor’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘first_meta’, ‘value’ => ‘2’, ), array( ‘key’ => ‘second_meta’, ‘value’ => ”, ‘compare’ => ‘!=’ ) ) ) ); where we’ve used the key, value and … Read more

WP_Query min and max values

Depending on the way your script is recording max_price, it isn’t really a meta_key/meta_value on postmeta table. Did you try changin max_price clause to something like this? [‘max_price’] => [ ‘relation’ => ‘OR’, [ ‘key’ => ‘max_price’, ‘value’ => 11, ‘compare’ => ‘<=’, ], [ ‘key’ => ‘max_price’, ‘compare’ => ‘NOT EXISTS’, ], ],

Query all posts where meta value is empty

I think you forgot about the inherit post status. The default one in WP_Query is publish. You should also use = instead of LIKE, to avoid using LIKE ‘%%’ in the SQL query. So try to add this: ‘post_status’ => ‘inherit’ and ‘compare’ => ‘=’ into your query arguments, to match the empty _wp_attachment_image_alt string … Read more

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