Convert WP_query to manual Oxygen query OR advanced query

35 Views Asked by At

I have the following working WP_query that I need to convert to a Oxygen query. manual or Advanced query. I have ofcourse a custom post_type named event containing and ACF field named event_date. The return format of event_date is set to Ymd

$today = date('Ymd');
      $homepageEvents = new WP_Query(array(
        'posts_per_page' => 4,
        'post_type' => 'event',
        'meta_key' => 'event_date',
        'orderby' => 'meta_value_num',
        'order' => 'ASC',
        'meta_query' => array(
          array(
            'key' => 'event_date',
            'compare' => '>=',
            'value' => $today,
            'type' => 'numeric'
          )
        )
      ));

I would prefer to make a manual query but when I insert the date condition it stops working

Works: post_type=event&posts_per_page=6

Breaks: post_type=event&posts_per_page=6&event_date>=date('Ymd')&type=numeric

Is there any way to write that $homepageEvents query manually or do I need to make an advanced query. My problem is that the advanced query is not responding to post_type event at all. So I have no output there

0

There are 0 best solutions below