Ascending not working

I have an ACF for my promotions, and set it up on my homepage so that promotions within the next 3 weeks (have custom field for promotions start and end date) will display, and I want them to display in ascending order (newest to oldest)…

I used the query builder in a slider container!

These are the settings with descending and it works…
image|332x264

But if I set it to ascending it no longer displays…
image

Am I doing something wrong?

(to get it to only show the next 3 weeks of events I set two conditions, one to only pull things AFTER the global date, and the second condition limits limits it to 3 weeks out using the promotion start date custom field)
image

Hello @dannycort

Thanks for writing to us.

In order to help you with your concerns, we need to check your settings. I would request please share the admin login details meanwhile I would suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks

Done and ready for you!

Thank you.

Hey @dannycort,

The Looper Provider Query Builder has a limited query filter. The meta_value_num OrderBy does not work with dates. What we can do is to use the Looper Provider Query String instead. We can have a query argument here:

$args = array(
    'post_type' => 'promotions',
    'posts_per_page' => -1,
    'meta_key' => 'promotion_start_date',
    'orderby' => 'meta_value',
    'order' => 'ASC',
    'meta_query' => array(
        array(
            'key' => 'promotion_start_date',
            'value' => array('2026-01-01', '2026-12-31'),
            'compare' => 'BETWEEN',
            'type' => 'DATE'
        )
    )
);

And running the echo http_build_query($args); will give us this query string:

post_type=promotions&posts_per_page=-1&meta_key=promotion_start_date&orderby=meta_value&order=ASC&meta_query%5B0%5D%5Bkey%5D=promotion_start_date&meta_query%5B0%5D%5Bvalue%5D%5B0%5D=2026-01-01&meta_query%5B0%5D%5Bvalue%5D%5B1%5D=2026-12-31&meta_query%5B0%5D%5Bcompare%5D=BETWEEN&meta_query%5B0%5D%5Btype%5D=DATE

Please review my demonstration at the URL I’ve added in the secure note below.

Thanks.