Support

Account

Home Forums Front-end Issues acf show custom field on date range Reply To: acf show custom field on date range

  • Hi Rich…

    Since you want both comparisons to be true, you can include an “AND relation” within the query:

    
    array(
      'relation' => 'AND',
      array(
        'key' => 'offer_start_date',
        'value' => $today,
        'compare' => '<='
      ),
      array(
        'key' => 'offer_end_date',
        'value' => $today,
        'compare' => '>='
      )
    )
    

    Also, here are more docs on date queries that may be useful.