Used ACF date and time plugin to add custom field for Auction Date and Time. I want to order the posts by this field. I have tried the Post Loop widget with the following to no avail:
meta_key=auction_date_time&orderby=meta_value&meta_compare=>=&meta_value=’.date(‘d/m/Y H:i’).’&order=ASC
It does seem to order them by the date and time; however, I was wanting to also remove auctions older than the current date. I tried using the meta_compare above but it still pulls all the posts. Any help with this would be greatly appreciated.
Thanks,
James
Hi Jamecky
Unfortunately, this isn’t possible with the post loop widget at this time due to the usage of PHP. You can get around this by using a filter, however. If you’re using just SitORigin Page Builder, you can use the siteorigin_panels_postloop_query_args filter. If you’re using the SitOrigin Widgets Bundle, use siteorigin_widgets_posts_selector_query.
You can get the current post by checking post__not_in which will always contain the current post id as the first id.