Meta_query by date for Events archive
Meta_query by date for Events archive
Meta_query by date for Events archive
Add ‘relation’ => ‘OR’ to your Meta Query, I think it will be something like this… ‘meta_query’ => array( ‘relation’ => ‘AND’, // Optional, defaults to “AND” array( ‘key’ => $country_meta_key, ‘value’ => $country, ‘compare’ => ‘LIKE’ ), array( ‘relation’ => ‘OR’, array( ‘key’ => $state_meta_key, ‘value’ => $us_state, ‘compare’ => ‘LIKE’ ), array( ‘key’ … Read more
There is one small issue. You have to user ‘IN’ instead of = because you want to check values with array $args = array( ‘role’ => ‘candidate’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘as_skills’, ‘value’ => array(‘skilla’,’skillx’,’skille’), ‘compare’ => ‘IN’ ), ), ); $test = get_users($args); echo “<pre>”; print_r($test); echo “</pre>”;
Sort loop by custom field from different post type
meta_query not filering but meta_key works fine
Ok, found the problem. I had to add ‘type’ => ‘numeric’, to my query. So the final code looks like: $adsAll = array( ‘post_type’ => $postType, ‘meta_key’ => $metaKey, ‘orderby’ => $orderBy, ‘order’ => $order, ‘posts_per_page’ => $PostsPerPage, ‘meta_query’ => array( array( ‘key’ => ‘preco_anuncio’, ‘value’ => array(‘8700′,’500000’), ‘compare’ => ‘between’, ‘type’ => ‘numeric’, ), … Read more
Order Posts By Custom Field That is an array of objects
compare for multiple meta values for same key in wp_query
You forgot the meta_query key in your $args. $meta_query = array( ‘relation’ => ‘OR’, array( ‘key’ => ‘tic_assignment’, ‘value’ => $current_user -> ID, ‘compare’ => ‘=’, ), array( ‘key’ => ‘tic_department’, ‘value’ => $_depts, ‘compare’ => ‘LIKE’, ), ); $_args = array ( ‘post_type’ => ‘tickets’, ‘meta_query’ => $meta_query, ‘posts_per_page’ => 10, ‘orderby’ => ‘date’, … Read more
How to get the posts that my following users are liked?