Query returning same results even though the ID changes

You can pass your meta query into query_posts or (the preferable) WP_Query in 2 ways: An array using the array keys meta_key, meta_value, meta_type and meta_compare An array of arrays using the array keys key, value, type and compare In your question, you were trying to use a mix of the two, and that’s why … Read more

Meta query date column add [x] days to validate

On top of my head this should be something like: ‘meta_query’ => [ ‘key’ => ‘_EventEndDate’, ‘value’ => [ $start, $end ], ‘compare’ => ‘BETWEEN’, ‘type’ => ‘DATETIME’ ] You would need to calculate boundaries yourself before passing to the query in this case. See Custom Field Parameters in Codex for full documentation on parameters … Read more

meta_query with multiple values optimization

Post meta data was never designed to be used efficiently in queries. Using it with LIKE based matching will only make it more horrible. You need to rethink your DB. For example use taxonomy terms to indicate which social network is associated with a post.

Query with meta_query and tax_query together not working properly

Tax query is formed wrong. It also array of arrays(queries) get_posts([ ‘meta_query’ => [ [ ‘key’ => ‘country’, ‘value’ => ‘Japan’, ‘compare’ => ‘LIKE’ ] ], ‘tax_query’ => [ [ ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => [‘kids’] ] ] ]); the array should look like this: Array ( [meta_query] => Array ( [relation] … Read more

Make meta query treat meta_value as 1 or 0

If I understand it correctly.. What you’re looking for can be achieved using the CASE statement in MySQL, where you would use the following in the ORDER BY clause: # group the quantity meta into two groups CASE # group one – all quantities that are 1 or more; we flag them as “1” WHEN … Read more

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