Query for post and costom post_type in same category filtered by meta for post_type

Solved. I needed to change meta_query this way: $meta_query = array( ‘relation’ => ‘OR’, array( ‘key’ => ‘public’, ‘value’ => ‘1’, ), array( ‘key’ => ‘public’, ‘value’ => ”, // necessary to work!!! ‘compare’ => ‘NOT EXISTS’ ), ); 1st array search for post with meta key ‘public’ set to 1 2nd array add post … Read more

meta_query array in ‘values’ returns an error

LIKE as a compare value doesn’t make sense with an array. You want compare to be IN. Also, you’ve got an extra set of quotes in the values for no reason: $meta_query_args = [ [ ‘key’ => ‘checkboxes’, ‘value’ => [‘facebook’, ‘twitter’], ‘compare’ => ‘IN’, ], ]; EDIT: So, according to your comment you’re using … Read more

Passing an array into WP_Query as a variable

First of all, you have a typo in your code. The variable with post IDs is called post_id_array, but your foreach loop uses post_ids_array (ids instead of id). When you fix this, then there’s one more problem. Meta query param should be an array of queries and each query should be an array. But your … Read more

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