Loop showing posts 'after and including' an ACF datetime field

Hi,

I need to filter a loop by a ACF DateTime field and only show posts from today included and onwards.

I’ve tried a lot of combinations but haven’t nailed it yet, if anyone can spot what I am missing.
I’m still getting all posts (no filtering).

<Loop type=post_type_name custom_date_field=field_name custom_date_field_type=datetime  custom_date_field_compare=after_inclusive custom_date_field_value=current>

On a different note the Beaver template module is throwing errors and locking things up after an update to either L&L or BB (for me anyway). Insert by template shortcode still works great.

UPDATE: Managed to get this sorted with some help from @avanti

I’ll leave it here if anyone needs to filter CPT posts based on ACF datetime field and show future posts including today.

Useful for events, etc.

<Set yesterday>
  <Date format=timestamp>yesterday</Date>
</Set>
<Loop type=post_type_name sort_field=date_time>
 <If check="{Field acf_date_time=date_time format=timestamp}" more_than value="{Get yesterday}">

</If>
</Loop>
2 Likes