Combining Meta_Query key values for one array

What if you use IN operator and split the search term in a words array: $args = array( ‘role’ => ‘Subscriber’, ‘meta_query’ => array( array( ‘key’ => ‘membership_class’, ‘value’ => ‘Full’, ‘compare’ => ‘=’, ‘type’ => ‘CHAR’, ), array( ‘relation’ => ‘OR’, array( ‘key’ => ‘first_name’, ‘value’ => explode( ‘ ‘, $usersearch ), ‘compare’ => … Read more

Meta Query with date and time on the same Day before given time

Found the error: $args = array( “posts_per_page” => 12, “paged” => $paged, “post_type” => array( “event”, “post” ) , “post_status” => “publish”, “meta_key” => “_thumbnail_id”, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘event_start’, ‘value’ => date(“Y-m-d H:i:s”) , ‘compare’ => ‘>=’, ‘type’ => ‘DATETIME’ ) , array( ‘key’ => ‘event_start’, ‘compare’ => ‘NOT … Read more

meta_query with multiple values

Expanding a bit on the answer from @dgarceran Generally, using the WP_Query class is probably a good idea for querying posts. We’ll want to pass arguments to that query. In your case we’ll likely want use one of the following: “Custom Field Parameters” – meta_query “Taxonomy Parameters” – tax_query For a nearly comprehensive example of … Read more

Order by two meta keys

I’m not 100% certain what specific order you’re asking for, but you just need to assign an associative array to the ‘orderby’ value. Here’s an example: $args = array( ‘post_type’ => ‘brands’, ‘meta_query’ => array( array( ‘key’ => ‘br_type’, ‘value’ => ‘Aviation’ ), array( ‘key’ => ‘br_category’ ), array( ‘key’ => ‘br_name’ ) ), ‘posts_per_page’ … Read more

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