Man, can't believe it was so hard to find a solution, would think it was a more common requested feature. But I'm glad I found your video, it works now, thanks a lot 👌
@@daveden2 I'm using Jet Enjine, Listing Grid but it doesn't work for me, so I'm using Loop Grid by Elementor. But can't sort my Loop Items by date from the jet engine custom field, I think they use different date formats. Had to install ACF and use your instructions. Had other issues with this on my site though.doesn't work for me, so I'm using Loop Grid by Elementor. But can't sort my Loop Items by date from the jet engine custom field, I think they use different date formats. Had to install ACF and use your instructions. Had other issues with this on my site though.doesn't work for me, so I'm using Loop Grid by Elementor. But can't sort my Loop Items by date from the jet engine custom field, I think they use different date formats. Had to install ACF and use your instructions. Had other issues with this on my site though. Thank you for your useful work!
Thanks for posting this video. I am using ACF and Elementor Pro. Could I do what you show with these or do I need Crocoblocks? I'm trying not to spend money until I can prove my website concept is good.
It's a good tutorial, For same day events. I have been looking for days for a code that also takes into account events that take place over several days so that they are no longer immediately visible on the start date. Maybe something for a part 2?
Wow, your video are very helpful bro. Can you show me how you create your custom events page? From start (ACF creation) to finished? I have mine but the start date, published date would not show in the back end so I will know when is the start and no need to open each event :) hope you understand my explanation hahaha? But you're awesome! Looking forward for more elementor ACF videos! Thank you.
Hi, thanks for the solutions. However, I'm using jetsmartfilters by crocoblock, which needs the query id field filled with jet-smart-filter to filter the loop grid. Do you know how can the query id listens to multiple ids?
What if you want taxonomy terms to appear in a certain order in this loop grid? For example, I use ACF, I have a taxonomy "Sale Type" and it contains these terms "Auction" "Buy" "Sold". In the loop grid the results appear according to the date published, however, I'd prefer the "Auction" results have priority and appear first, then the "Buy" results, then the "Sold" results. Do you have any suggestions? Thank you
I'll look into it. But from what I've seen, there's no direct way to order posts by a taxonomy term, primarily because a post can have multiple terms. My suggestion would be to do one of 2 things: 1. Do 3 different listings, one for each term or 2. add a meta field that's equal to the primary term, then order by that meta value. But I'll do some more research on it.
@@daveden2 friend, thank you very much! I implement this code but the past events do not disappear. change 'start_date' to my key. How do I make it work? thank you!
Hello, thanks for the tip, but i would like to ask you if exist a solution to order by ACF date and hour, i mean i have a date field and a hour field, then if for example today i do an event from tomorrow at 6pm and tomorrow i did another event with the same date but at 4pm, then i would like to show also the order by hour. How can i do that? Thank you in advance.
@@daveden2 Hello Daveden, i have tree ACF fields, one of them is a date and hour selector, I use this one to put a counter down in the event post, the other ones are a date selector and an hour selector, I use those fields in the post loop, I am using your code to order the loop by date and it works but if i have two or tree different events in the same date I also want to put in order by hour. For example, right now suppose i create today 2 events and tomorrow the other one, the first two events with 8pm and 9pm and the third one for 6pm, so in the loop appears without time order, first 8pm, 9pm and last 6pm. I would like that the loop takes the order firstable by date selector and then by the hour selector of the ACF fields. Tahnk you
You can try this code and let me know if it works. Ensure that: 1. ACF date field = start_date 2. ACF time field = start_time. 3. ACF date return format = 'Ymd' 4. ACF time return format = H:i:s, to make calculations easier. 5. Elementor Query ID = dd_event_date_time Code Snippet ============
@@harvinderdhami9795 I just published a written tutorial for you. Let me know if it works. I'll try to get a video out as well. daveden.co.uk/tutorials/sort-your-elementor-loop-grid-by-acf-checkbox-to-prioritise-sold-items-last/
I'm using Elementor 3.20.3, and there is not a "Query ID" field. It shows a field called "Advanced Query Options", with a whole different set of settings. Can you help here? Thanks, man!
Yes, I'm using Advanced Queries. But I read somewhere that this solution doesn't work with WooCommerce itens in the loop grid. And that's what I needed. 😬
@tiagolacerda77 ah I see. I've never used Advanced Queries before. So I don't know much about it. I typically either write my own custom query or use JetEngine's Query Builder
This worked really well. Thank you! :)
You're welcome. I'm glad to hear that
Man, can't believe it was so hard to find a solution, would think it was a more common requested feature. But I'm glad I found your video, it works now, thanks a lot 👌
Oh man. Thanks for this. You’re the boss ! I prefer ACF. I did use CPT but I’m more used to ACF as an all in one now.
Yeah, since ACF integrated creating CPTs and Taxonomies, they seem to be the most popular choice
You are my savior! However, I was unable to do this with Jet Engine, so I installed ACF in addition. But now it works and I'm happy ;)
I'm glad it worked out well for you! I'll look into the JetEngine version.
@@daveden2 I'm using Jet Enjine, Listing Grid but it doesn't work for me, so I'm using Loop Grid by Elementor. But can't sort my Loop Items by date from the jet engine custom field, I think they use different date formats. Had to install ACF and use your instructions. Had other issues with this on my site though.doesn't work for me, so I'm using Loop Grid by Elementor. But can't sort my Loop Items by date from the jet engine custom field, I think they use different date formats. Had to install ACF and use your instructions. Had other issues with this on my site though.doesn't work for me, so I'm using Loop Grid by Elementor. But can't sort my Loop Items by date from the jet engine custom field, I think they use different date formats. Had to install ACF and use your instructions. Had other issues with this on my site though.
Thank you for your useful work!
Very useful! Thank you Daveden
This is fantastic! I was so close to giving up and using a plug-in, but you've given me hope.
Ah, I see! I'm glad I was able to help
Thank you so much you are an excellent teacher.
I'm glad it worked out for you! Thanks a lot for the compliments!
Thank you so much for this! Elementor has so many limitations but you are amazing at helping us get around them
Thanks! I'm glad you enjoyed the video. Hopefully, elementor will create easier ways to implement these soon.
Thanks Daveden, tried a different tutorial and it didn't work but this worked perfectly :)
Absolutely brilliant! Thanks so much. Exactly what we were looking for!!
This worked perfectly. Thank you!
Very thorough! Thank you!
You're welcome. Thanks for the comment!
Thank you very much! This was a great solver!
Very Nice tutorial. working as well.
Thank you very much for your tutorial 👍
I'm glad it helped you
Thank you very much for this!
You're welcome
Thank you! This helped me alot.
I'm glad to hear that
Excellent Video!
Thank you so much!!!
This is exactly what I needed
Here's a link to the feature request to make this native in Elementor -
github.com/orgs/elementor/discussions/22156
Thanks for posting this video.
I am using ACF and Elementor Pro.
Could I do what you show with these or do I need Crocoblocks? I'm trying not to spend money until I can prove my website concept is good.
You don't need JetEngine. The method I showed in the video works well with ACF.
Thank you!
It's a good tutorial, For same day events. I have been looking for days for a code that also takes into account events that take place over several days so that they are no longer immediately visible on the start date. Maybe something for a part 2?
I would expect the code to work for a multiday event as well.
The code hides events based on the "start_date" ACF date field.
Wow, your video are very helpful bro. Can you show me how you create your custom events page? From start (ACF creation) to finished? I have mine but the start date, published date would not show in the back end so I will know when is the start and no need to open each event :) hope you understand my explanation hahaha? But you're awesome! Looking forward for more elementor ACF videos! Thank you.
I'm glad that the videos have been helpful.
I'll try to work on a start-to-finish video.
Hi, thanks for the solutions.
However, I'm using jetsmartfilters by crocoblock, which needs the query id field filled with jet-smart-filter to filter the loop grid.
Do you know how can the query id listens to multiple ids?
Wow, I never considered that scenario. I'll do some research and get back to you.
Gracias Crack!!, 🤯🙏
That's cool mate! is it possible to do same with another ACF field like an OrderId which is a number? I might just modify the comparing function?
You can try this modified query, where the query id is 'dd_order_id' and the ACF field is 'event_order_id'
Dear Daveden, does it also work for nested repeater fields? In my case, both my Dates field and Event field are repeaters. Should I change anything?
To the best of my knowledge, the Elementor loop grid doesn't work well with repeater fields.
What if you want taxonomy terms to appear in a certain order in this loop grid? For example, I use ACF, I have a taxonomy "Sale Type" and it contains these terms "Auction" "Buy" "Sold". In the loop grid the results appear according to the date published, however, I'd prefer the "Auction" results have priority and appear first, then the "Buy" results, then the "Sold" results. Do you have any suggestions? Thank you
I'll look into it. But from what I've seen, there's no direct way to order posts by a taxonomy term, primarily because a post can have multiple terms.
My suggestion would be to do one of 2 things:
1. Do 3 different listings, one for each term or
2. add a meta field that's equal to the primary term, then order by that meta value.
But I'll do some more research on it.
@@daveden2 thanks Dave! Yes at the moment I’m currently utilising your suggested method 1. It’s a tricky one
Thanks. We need the second function that help to expire posts based on date field. Please make the tutorial or put the code in the description.
Once I run some more tests, I'll update the post / release a follow up video
@@daveden2 ok
I've updated the article - daveden.co.uk/tutorials/order-elementor-loop-by-acf-date-field/. Please let me know if it works for you
@@daveden2 friend, thank you very much! I implement this code but the past events do not disappear. change 'start_date' to my key. How do I make it work? thank you!
@@gonzalorozas1769 did you set the date format to Y-m-d?
Hello, thanks for the tip, but i would like to ask you if exist a solution to order by ACF date and hour, i mean i have a date field and a hour field, then if for example today i do an event from tomorrow at 6pm and tomorrow i did another event with the same date but at 4pm, then i would like to show also the order by hour. How can i do that? Thank you in advance.
Yes, you'd have to create an array for the orderby in the query.
What type of acf field is the hour field?
@@daveden2 Hello Daveden, i have tree ACF fields, one of them is a date and hour selector, I use this one to put a counter down in the event post, the other ones are a date selector and an hour selector, I use those fields in the post loop, I am using your code to order the loop by date and it works but if i have two or tree different events in the same date I also want to put in order by hour. For example, right now suppose i create today 2 events and tomorrow the other one, the first two events with 8pm and 9pm and the third one for 6pm, so in the loop appears without time order, first 8pm, 9pm and last 6pm. I would like that the loop takes the order firstable by date selector and then by the hour selector of the ACF fields.
Tahnk you
@@cristianpacher9992 okay, I'll look into it and get back to you soon
You can try this code and let me know if it works. Ensure that:
1. ACF date field = start_date
2. ACF time field = start_time.
3. ACF date return format = 'Ymd'
4. ACF time return format = H:i:s, to make calculations easier.
5. Elementor Query ID = dd_event_date_time
Code Snippet
============
Can you post the code to change status to draft? or where you found it?
Thanks for the reminder. I'll update my post as soon as I can.
I've updated the article - daveden.co.uk/tutorials/order-elementor-loop-by-acf-date-field/. Please let me know if it works for you
What's your preferred plugin for creating CPTs and Custom Fields?
CrocoBlock
@@shahinulislam9304JetEngine is really powerful
JetEngine :) But I like the new interface of ACF.
@@LudovicCharlier yeah, me too. The new ACF interface looks really nice
How can we use this for a checkbox field? If I wanted to sort posts that have the checbox marked to display last?
Sorry, I'm not sure how to do that yet. I'll have to take a closer look.
So, are there multiple checkboxes. Or how is the setup?
@@daveden2 Would be greatly appreciated. No there is only a single checkbox that is called "Status" and it has a value of "Sold"
@@harvinderdhami9795 I just published a written tutorial for you. Let me know if it works. I'll try to get a video out as well.
daveden.co.uk/tutorials/sort-your-elementor-loop-grid-by-acf-checkbox-to-prioritise-sold-items-last/
@@daveden2 Hi Buddy, thanks for the tutorial, ive tried to check it out today however your website seems to be throwing a BAD GATEWAY error 502
@@harvinderdhami9795 , thanks for the heads-up. My host changed their ip. I'll get it sorted asap
I'm using Elementor 3.20.3, and there is not a "Query ID" field. It shows a field called "Advanced Query Options", with a whole different set of settings. Can you help here? Thanks, man!
That could be from an Elementor addon. On your plugins page, do you have a plugin like Advanced Queries?
Yes, I'm using Advanced Queries. But I read somewhere that this solution doesn't work with WooCommerce itens in the loop grid. And that's what I needed. 😬
@tiagolacerda77 ah I see. I've never used Advanced Queries before. So I don't know much about it. I typically either write my own custom query or use JetEngine's Query Builder
I'm also unable to find "Query ID" :/
@@yurifontanive1394, are you also using Advanced Queries?
How to show all posts without the array 'compare'?
Simply remove the meta_query
This is exactly what I needed