Wow, you've truly rescued me! I've been searching for a solution to this for a while. I feel incredibly fortunate to have stumbled upon your video. Thank you immensely! I've subscribed!
Andrea, I just love your channel so much. We need more content like this about wordpress, to differentiate our projects. Most wordpress content on youtube is about basic stuff or templates, but you teach us something awesome! keep doing it please
Thank you so much, Ricko! Yeah, I saw that there was a lack of ...let's call it spice in the WP design community and I said, I might as well have a go at it. I love what web designers are doing with Webflow and I use that as inspiration for what I teach on this channel. We definitely need the basic stuff too but we need to move away from the basic WordPress cookie-cutter designs in this day and age otherwise we'll be left behind. Let me know if you have any requests for future videos🤓
YES! Exactly what I needed to learn! I just launched a website that I used ACF to create events. Now I can go back and add that code! LOL. WOW. Yes keep doing more of all these videos you're doing. Totally in alignment with what I need to know! Thank you!
Hi@@andreaegli I am sorry I just saw this reply now, I tried writing the steps and code in this google doc docs.google.com/document/d/1zTD_RIq2iC7Ajmx4nFyJzVHirMlSDZALFw5uFPFJ07w/edit?usp=sharing
never mind i found it, add_action( 'elementor/query/filter_date', function( $query ) { $today = date('Ymd'); $meta_query = [ [ 'key' => 'date', // replace 'date' with the key of your date custom field 'value' => $today, 'type' => 'DATE', 'compare' => '>=', ] ]; $query->set( 'meta_query', $meta_query ); $query->set( 'orderby', 'meta_value' ); // Order by the value of the meta field $query->set( 'meta_key', 'date' ); // Replace 'date' with the key of your date custom field $query->set( 'order', 'ASC' ); // Order posts in ascending order based on the date } ); this code works (at least for me)
If you look at the title of the date format section on the date field, it says 'Display Format' which isn't how a date is stored, just how it's formatted when displayed. Almost ALL dates are stored as YMD as it's more efficient.
This is great! One question though - Would it be possible to show the upcoming events in one section, but then also have past events only listed in another section?
Thank you, great Job! Is it possible to create a link to calendar? For example, I click on a button and it automatically open the Google Calendar and ask for saving the event?
Hi Andrea, thanks for the great video. I have a question: Do you see the possibility to add repeating events via ACF somewhere? Maybe someone else has an idea? 😃
Hi I am currently following this tutorial, I'd like to know how I can add a format date with a start date and an end date for events that are on several days ? I'd like the date to be "from xx/xx/xx to xx/xx/xx"
Hi, Thank you for your videos realy helpfull! One question is it possible to make the order list with the date of the event and not the date that was published?? Thank you! (also is there a way to make the event page editable by elementor? I am creating a secont page to redirect the event to the page i want to make the design as i like and it is realy time consuming)
Andrea - This was exactly what I needed! A way to show current and future events but not past! But now if I want to show only past events but not future in another area of my website, can I use the same code but alter it and create a new query ID? How would I alter the code?
Hey Jill! So happy to hear that it helped you ☺️ you can create a new query ID and simply add all past events in the backend. No need to use the code in this case.
Hi, Andrea - do you have any idea why this recently changed? Only Future dates do display, so that works...but they are not in the correct order? Whether I do ACS or DCS, the order of the my next four dates show up in this order: September 27,. September 13, October 25, October 4. How do I get them to display in chronological order?
Hey Jill! Have you added them at the same time? the problem with this solution is that you need to add the events all at the same time in chronological order. Any event you add afterwards will show up last even if the date of the event is not last.
Hey Paul! Hmmm, I'm sure it works with Gutenberg but I have no idea how to display the info...I think ACF have a version of blocks coming out in November...
Hi Andrea, thanks for this tutorial, it's given some great ideas, however, I am struggling with one part of the build, at roughly 7.00 into the video you say "OK let's move on to Elementor and add our loop grid" I can't figure out where this is, ie are you building a template? is it a loop item, a container, a section, etc, I just cant see where to add a loop grid? Thank for any help.
Hey, Colin! Glad to see that you have found this useful! Ok, most probably you have not activated the Loop feature in Elementor. So, go to Dashboard > Elementor > Settings > Features and scroll all the way down until you see Loop. Turn that bad boy on and then go back to your Elementor editor and look for the loop grid widget. From here you can follow along with the video. Let me know if you need more help
Yes, you can, the loop builder has that option which is pretty good. Have you managed to fix the date custom post type not showing up? I was going to reply to your comment but i guess you deleted it...
@@andreaegli yeah i fix the date issue, but the pagnination on prev/next update the url when using, so its not on ajax... like load more it dont update the url.
Hi, thanks for the excellent tutorial. There is one small detail: If I have an event on June 5, 2023 and another on February 10, 2024 the 2024 event appears first in the list. Any recommendation? Thank you.
#andreaegli Thanks for the useful videos but I want to ask if I want to show only the current date post it depends on Day, not the year just like the celebrities' birthday website
Hey Alina! I’m afraid seems the code has some issues and I haven’t had time to look into it. Can you send me an email with your exact issue and what you’re trying to achieve?
Have you found this useful? Would you like to see more complex videos around ACF?
Your code snippet was a lot easier than what i did in the past, thank you for this!
Wow, you've truly rescued me! I've been searching for a solution to this for a while. I feel incredibly fortunate to have stumbled upon your video. Thank you immensely! I've subscribed!
Andrea, I just love your channel so much. We need more content like this about wordpress, to differentiate our projects. Most wordpress content on youtube is about basic stuff or templates, but you teach us something awesome!
keep doing it please
Thank you so much, Ricko! Yeah, I saw that there was a lack of ...let's call it spice in the WP design community and I said, I might as well have a go at it. I love what web designers are doing with Webflow and I use that as inspiration for what I teach on this channel. We definitely need the basic stuff too but we need to move away from the basic WordPress cookie-cutter designs in this day and age otherwise we'll be left behind. Let me know if you have any requests for future videos🤓
YES! Exactly what I needed to learn! I just launched a website that I used ACF to create events. Now I can go back and add that code! LOL. WOW. Yes keep doing more of all these videos you're doing. Totally in alignment with what I need to know! Thank you!
YAY! I'm a mind reader! LOL!!! so happy this helped you and I will keep making these kind of videos🤩
You're a life saver! After months of trial and error, this worked like a charm!
This is the best tutorial on this topic that I've found. Thank you.
Thank you. I managed to follow your tutorial and got things working fine. I added custom querys to order by upcoming date also. Thank you very much.
Hey, that is awesome! Could you share the custom queries with me? You are very welcome!
Hi friend can you share the code because whatever i try i can't make it work!
Hi@@andreaegli I am sorry I just saw this reply now, I tried writing the steps and code in this google doc docs.google.com/document/d/1zTD_RIq2iC7Ajmx4nFyJzVHirMlSDZALFw5uFPFJ07w/edit?usp=sharing
never mind i found it,
add_action( 'elementor/query/filter_date', function( $query ) {
$today = date('Ymd');
$meta_query = [
[
'key' => 'date', // replace 'date' with the key of your date custom field
'value' => $today,
'type' => 'DATE',
'compare' => '>=',
]
];
$query->set( 'meta_query', $meta_query );
$query->set( 'orderby', 'meta_value' ); // Order by the value of the meta field
$query->set( 'meta_key', 'date' ); // Replace 'date' with the key of your date custom field
$query->set( 'order', 'ASC' ); // Order posts in ascending order based on the date
} );
this code works (at least for me)
If you look at the title of the date format section on the date field, it says 'Display Format' which isn't how a date is stored, just how it's formatted when displayed. Almost ALL dates are stored as YMD as it's more efficient.
Great for you¡¡¡ lovely tutorial. Resolved my problem. Thanks
😉
THANK YOU! This is so so helpful. Game changing.
You are very welcome 🤗
Life saver . Thank you so much for sharing
😌 you’re very welcome
Thank you!
this is what i am looking for - thanks
welcome!
This is great! One question though - Would it be possible to show the upcoming events in one section, but then also have past events only listed in another section?
It would be super useful for me too !
Good job, keep up the good work! ☺️👍👏👏👏👏❤️❤️🥰
thank you, Kamy! will do🤩
Thank you so much for your tutorial, how can I change the code to ask it to focus on passed events instead of future events ?
Thank you, great Job! Is it possible to create a link to calendar? For example, I click on a button and it automatically open the Google Calendar and ask for saving the event?
Thank you 😀 yes, but it’s quite complicated to do that. I will look into it and see if I can get that done
Hi Andrea, thanks for the great video. I have a question: Do you see the possibility to add repeating events via ACF somewhere? Maybe someone else has an idea? 😃
Hey Simon, thank you 😊 I’m sure there’s a way but I don’t know off the top of my head. Anyone else? Welp 🤓
Hi I am currently following this tutorial, I'd like to know how I can add a format date with a start date and an end date for events that are on several days ? I'd like the date to be "from xx/xx/xx to xx/xx/xx"
Hi Andrea, nice video! My only issue is, how can i add this template of Meeting to mi Wordpress Menu?
Hi,
Thank you for your videos realy helpfull! One question is it possible to make the order list with the date of the event and not the date that was published??
Thank you!
(also is there a way to make the event page editable by elementor? I am creating a secont page to redirect the event to the page i want to make the design as i like and it is realy time consuming)
I set in the advanced configuration has archive. Is there a reason why you didn't set this for the post type?
I guess I just overlooked it ☺️
Merci, tu es au top 🤜🤛
Merci! Je vous en prie 🤓
@@andreaegli you speak french very well it's a pleasure for me 🤜🤛your best fan from France ⚜️❤️
@@jean-mahmoud_du_tacobel my french is a bit rusty but google translate helped a bit
@@andreaegli Well, i'm sure you are also beautifull than your french is too
Andrea - This was exactly what I needed! A way to show current and future events but not past! But now if I want to show only past events but not future in another area of my website, can I use the same code but alter it and create a new query ID? How would I alter the code?
Hey Jill! So happy to hear that it helped you ☺️ you can create a new query ID and simply add all past events in the backend. No need to use the code in this case.
@@andreaegli Not sure how to "add all past events in the backend"?
@@jillciporin8511 add them just like you have added the current and future events
Hi, Andrea - do you have any idea why this recently changed? Only Future dates do display, so that works...but they are not in the correct order? Whether I do ACS or DCS, the order of the my next four dates show up in this order: September 27,. September 13, October 25, October 4. How do I get them to display in chronological order?
Hey Jill! Have you added them at the same time? the problem with this solution is that you need to add the events all at the same time in chronological order. Any event you add afterwards will show up last even if the date of the event is not last.
This is exactly what I was looking for to solve a problem I had. Is there a way to do this without using Elementor? I use Gutenberg.
Hey Paul! Hmmm, I'm sure it works with Gutenberg but I have no idea how to display the info...I think ACF have a version of blocks coming out in November...
Hi Andrea, thanks for this tutorial, it's given some great ideas, however, I am struggling with one part of the build, at roughly 7.00 into the video you say "OK let's move on to Elementor and add our loop grid" I can't figure out where this is, ie are you building a template? is it a loop item, a container, a section, etc, I just cant see where to add a loop grid? Thank for any help.
Hey, Colin! Glad to see that you have found this useful! Ok, most probably you have not activated the Loop feature in Elementor. So, go to Dashboard > Elementor > Settings > Features and scroll all the way down until you see Loop. Turn that bad boy on and then go back to your Elementor editor and look for the loop grid widget. From here you can follow along with the video. Let me know if you need more help
@@andreaegli Sorted many thanks Andrea
Is it possible to choose AJAX for pagnination prev/next ? like load more ?
Yes, you can, the loop builder has that option which is pretty good. Have you managed to fix the date custom post type not showing up? I was going to reply to your comment but i guess you deleted it...
@@andreaegli yeah i fix the date issue, but the pagnination on prev/next update the url when using, so its not on ajax... like load more it dont update the url.
Hi, thanks for the excellent tutorial. There is one small detail: If I have an event on June 5, 2023 and another on February 10, 2024 the 2024 event appears first in the list. Any recommendation? Thank you.
Try this:
add_action( 'elementor/query/filter_date', function( $query ) {
$today = date('Ymd');
$meta_query = $query->get( 'meta_query' );
$meta_query = [
[
'key' => 'event_start_date', // Replace with your custom field name
'value' => $today,
'type' => 'DATE',
'compare' => '>=',
]
];
$query->set( 'meta_query', $meta_query );
$query->set( 'orderby', 'meta_value' ); // Sort by the custom field 'event_start_date'
$query->set( 'order', 'ASC' ); // Sort in ascending order (earliest date first)
} );
#andreaegli Thanks for the useful videos but I want to ask if I want to show only the current date post it depends on Day, not the year just like the celebrities' birthday website
You're welcome! That is a bit more complicated and requires additional code
thank you very much!
I don't know why but it filters my events by date of publication and not the date that I put in the event... Can you help me?
Hey Alina! I’m afraid seems the code has some issues and I haven’t had time to look into it. Can you send me an email with your exact issue and what you’re trying to achieve?
I found a solution, thank you for your video, really helped me !
@@LaRevedereBunica I have the same problem. What was the solution?
Hi ! Have you been able to look into the code ? There is indeed a bug@@andreaegli
Hey guys Im having the same problem would love you all forever if you have a solution?
No mams te amo, gracias!
❤❤❤
Thank you very much!