-
cleanpagedom
Hi David
I’ve recorded myself double-chekcing this and the field name – just so I get clear in my own mind that I’ve set it up correctly.
https://www.loom.com/share/4383904722db4859aafe390c1b7ed7a8?sid=c9991cc3-94dc-4275-b806-26da4a7c344e
Maybe you’ll spot something I’ve done wrong? Otherwise I’m at a loss.
Thanks
Dom -
David
What’s the return format of the ACF date custom field ?
-
cleanpagedom
Y-m-d H:i:s(YYYY-MM-DD HH:II:SS) according to the resources.https://www.advancedcustomfields.com/resources/date-time-picker/
-
cleanpagedom
Oh, I can edit this. This is what I have set: https://ibb.co/dcDSTB6
-
David
Hmmm… I can’t see what is wrong.
That all looks correct to me.Check for plugin conflicts ?
-
cleanpagedom
OK, will try that next.
What should I see with the
var_dumphook? Should that output the date/time? -
You have 2 query loops with the same CSS class
order-priorityon the same page, can you remove one of the query loop blocks to test? -
cleanpagedom
Hi all
I’ve deactivated all plugins save for GP Premium GB/GB Pro and ACF Pro
I’ve added a new number field group called “Priority” and added this to the
var_dump– it still displays “array(0) {}”I’ve then added a numeric priority to each of the events posts
I’ve copied the code for numeric values directly from the tutorial
Purged all cache
It still doesn’t sort them into an order.
Next, I tried adding the Priority custom field to a standard post categorised as “Test Category” and created a completely new query loop displaying this category. Grid has CSS class “order-by-number”, which I then changed in the functions.php
https://staging-inspirewomenoldham-co-uk.stackstaging.com/test-category-sorting/
It’s not sorting these either.
I do very much appreciate your continued support on this, btw.
Thanks
Dom -
Fernando
Hi Dom,
I see. Can you share admin login credentials to this Staging site through the Private Information field? We’ll try to do some tests.
-
cleanpagedom
Will do.
Thanks
Dom -
David
The
var_dumpwon’t work on the archive page.
It would only work on the single post where the ACF field is located.But considering the ACF date appears in your loops template then we know its getting a value.
Its whether its a) valid for the query or b) the filter hook is actually working as expected.I logged into your site, and temporarily activated the child theme. And the filter function in there worked on the archive page… so that function is working.
So I took a peak at the child theme functions and noticed there was an ACF filter for adding
@support in the datetime fields. Was that active when testing the date field? -
cleanpagedom
Ah, OK. Yes, the @ support has been there a while, although not throughout, I don’t think. I’ll try removing that.
-
cleanpagedom
OK, I’ve removed the @ support and added the var_dump hook to individual events. So now something is being outputted to the events, but the query loop is not sorting into order.
-
cleanpagedom
A breakthrough of sorts. I removed the @ support and tried again with the simple “Priority” number field – and that is now working on the test loop: https://staging-inspirewomenoldham-co-uk.stackstaging.com/test-category-sorting/
I’ll come back to this on Monday and see if I can get the dates to do the same thing.
Have a good weekend.
-
cleanpagedom
I couldn’t leave it alone. I got it working with a date field (no time) using the third example in the tutorial. This might be enough, unless they decide to run multiple events on the same day.
I might have another go with the date and time next week.
Again, can’t thank you enough for the help.
Dom
-
Glad to hear that Dom, I tested the DATETIME type on my site and it worked as expected, so I assume it should work on your site as well 🙂
Have a great weekend!
- You must be logged in to reply to this topic.