WordPress – Optimize the Meta Query for 3 meta keys at a time

Conclusion – In my case I tried below When I changed placement of last meta or at the first place worked perfectly. <?php $price_from = ’20’; $price_to = ‘700’; $meta_query_price[] = array( ‘relation’ => ‘OR’, array( ‘key’ => ‘price_type’, ‘value’ => ‘POA’, ‘type’ => ‘value’, ‘compare’ => ‘LIKE’ ), array( ‘relation’ => ‘AND’, array( ‘key’ …

Read more

WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)

Resolved. My error are there : $FirstDayThisMonth[] = date(‘Y-m-01 00:00:01’, mktime(0, 0, 0, $x, 1)); $LastDayThisMonth[] = date(‘Y-m-t 23:59:59’, mktime(0, 0, 0, $x, 1)); instead of : $datestart = strtotime(date(‘Y-‘.$nbofmonth.’-01 00:00:01′)); $dateend = strtotime(date(‘Y-‘.$nbofmonth.’-t 23:59:59′)); It’s always very annoying to have well written code and to realize that a small element breaks everything