Thanks Josh. This is fantastic! I've been using Modern Events Calendar plugin for a few clients that needed a more robust events calendar with booking and different displays. But, I have a client that just wants events listed with a link and a look that closely matches their branding. I had been manually designing each event page for them so this is the perfect way to let them post their own events. This is the perfect solution! There's no chance I would have figured out the query string on my own. Thanks again for another awesome tutorial.
Brilliant! How had j never heard of CPT before?! Those queries are a big gap in my knowledge too. I've saved this video for future reference, thank you!
great video! 👍 I'm guessing for appointments it would be a little bit more involved.. but nonetheless this is a good solution for when someone offers classes or multi day events..
Thanks @rspaulding! Appreciate the feedback. The Query Builder is great for setting up simple (even mildly complex) queries that tap into default data (posts types, taxonomies, publish dates, titles, etc.) and you can absolutely use it for building out your queries - but once we get into the weeds on some of the more advanced query functionality like orderby=meta_value and meta_key=acf_field we need to move to custom query strings.
Great explanation of the query string and the meanings of the brackets code. Brilliant content and I think I'll give this a try on my dev site. What screen recording software do you use ?
Thanks Kenny! To be honest, it’s just QuickTime Screen Recording (default for every Mac) + Pro Mouse ($3.99). Works wonders. apps.apple.com/us/app/pro-mouse/id1505869474?mt=12
Hey Josh, I have just implemented this without any issues, great tutorial. Just wondering if you could help with extending this so that when no events are present (or more tot he point, when all events which could still be technically published but all are expired), a "there are no events to show, please check back later" message could be displayed. How can that sort of conditional logic be tooled in this use case?
Thanks for the tutorial! Follow up question about archives. This works great when you're doing a low key calendar, but the part I'm struggling with is with the archive page. Because if I use your code, I can't have post navigation. Any thoughts? You mentioned that you did this for a client, so I'm curious about how you figured out the archive page/master calendar view. Thanks!
Not sure I'm following. Events take place on dates which makes this a calendar. That said, if you're looking for more of an actual calendar design (grid of boxes) that's a bit of a heavier lift.
Hi @andrei - when adding the custom fields that we begin covering at roughly the 4:08 mark in the video - simply add custom fields for whatever additional details you'd like to include. For example, you could add a field for artist / band, you could add a field for venue address, you could add a field genre taxonomy, and so on and so forth.
I should have watched this before going crazy for 6h straight to find out how to sort out custom posts by date. I'm just wondering now if it's possible do separate events by month, like a row for each month (or a slide in a slider). Any tips to achieve this?
Don't see why not. For that you'd likely want to jump into your functions.php. This is completely untested but perhaps something like: // Get today's date $today_date = new DateTime(); // Calculate the date 10 days ago $ten_days_ago = $today_date->modify('-10 days')->format('Ymd'); // Query to retrieve posts within the 10-day range $args = array( 'post_type' => 'YOUR_CPT', 'orderby' => 'meta_value', 'meta_key' => 'YOUR_ACF_FIELD', 'order' => 'asc', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'YOUR_ACF_FIELD', 'value' => $ten_days_ago, 'compare' => '>=', 'type' => 'DATE', ), array( 'key' => 'YOUR_ACF_FIELD', 'value' => date('Ymd'), 'compare' => '
Thank you. The query string part has clarified some things I’ve been struggling with in my acf build. Thanks.
Glad you found it useful!
Thanks Josh. This is fantastic! I've been using Modern Events Calendar plugin for a few clients that needed a more robust events calendar with booking and different displays. But, I have a client that just wants events listed with a link and a look that closely matches their branding. I had been manually designing each event page for them so this is the perfect way to let them post their own events. This is the perfect solution! There's no chance I would have figured out the query string on my own. Thanks again for another awesome tutorial.
So glad you found the tutorial helpful! Happy building :)
Brilliant! How had j never heard of CPT before?! Those queries are a big gap in my knowledge too. I've saved this video for future reference, thank you!
Really good stuff Josh! Very helpful and nicely presented
Thanks Scot!
Nice work Josh.
great video! 👍 I'm guessing for appointments it would be a little bit more involved.. but nonetheless this is a good solution for when someone offers classes or multi day events..
Man, your CS videos are so helpful!! Question, why can't the Query Builder do the queries you're adding here?
Thanks @rspaulding! Appreciate the feedback.
The Query Builder is great for setting up simple (even mildly complex) queries that tap into default data (posts types, taxonomies, publish dates, titles, etc.) and you can absolutely use it for building out your queries - but once we get into the weeds on some of the more advanced query functionality like orderby=meta_value and meta_key=acf_field we need to move to custom query strings.
Great explanation of the query string and the meanings of the brackets code. Brilliant content and I think I'll give this a try on my dev site. What screen recording software do you use ?
Thanks Kenny! To be honest, it’s just QuickTime Screen Recording (default for every Mac) + Pro Mouse ($3.99). Works wonders.
apps.apple.com/us/app/pro-mouse/id1505869474?mt=12
thanks this is what im looking for
Hey Josh, I have just implemented this without any issues, great tutorial. Just wondering if you could help with extending this so that when no events are present (or more tot he point, when all events which could still be technically published but all are expired), a "there are no events to show, please check back later" message could be displayed. How can that sort of conditional logic be tooled in this use case?
Did you ever figure out how to do this?
Thanks a lot bro :)
You're welcome!
Thanks for the tutorial! Follow up question about archives. This works great when you're doing a low key calendar, but the part I'm struggling with is with the archive page. Because if I use your code, I can't have post navigation. Any thoughts? You mentioned that you did this for a client, so I'm curious about how you figured out the archive page/master calendar view. Thanks!
great one! also usable with Wordpress Elementor?
Thanks @Pixl -- I don't see why not. Same methodology should apply even if the process of application is slightly different.
I'm looking for how to create a calender in wordpress, but unfortunately all the tutorials are on how to create events
Not sure I'm following. Events take place on dates which makes this a calendar. That said, if you're looking for more of an actual calendar design (grid of boxes) that's a bit of a heavier lift.
Hi, how to add bands or artists ?
Hi @andrei - when adding the custom fields that we begin covering at roughly the 4:08 mark in the video - simply add custom fields for whatever additional details you'd like to include. For example, you could add a field for artist / band, you could add a field for venue address, you could add a field genre taxonomy, and so on and so forth.
@@buildingonwordpress thx you, i want to create venue manager like with the events and on add a event page to have a selector to select the venue
I should have watched this before going crazy for 6h straight to find out how to sort out custom posts by date. I'm just wondering now if it's possible do separate events by month, like a row for each month (or a slide in a slider). Any tips to achieve this?
Thanks @RenanDadalte! That one definitely gets a bit tougher. I'd need to think through it a bit, functionally. I'm sure there's some way.
Is there a way to filter by dates that havent happened yet in elementor?
Can we set the query to show only the upcoming events within 10 days. and all other events remains hide
Don't see why not. For that you'd likely want to jump into your functions.php. This is completely untested but perhaps something like:
// Get today's date
$today_date = new DateTime();
// Calculate the date 10 days ago
$ten_days_ago = $today_date->modify('-10 days')->format('Ymd');
// Query to retrieve posts within the 10-day range
$args = array(
'post_type' => 'YOUR_CPT',
'orderby' => 'meta_value',
'meta_key' => 'YOUR_ACF_FIELD',
'order' => 'asc',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'YOUR_ACF_FIELD',
'value' => $ten_days_ago,
'compare' => '>=',
'type' => 'DATE',
),
array(
'key' => 'YOUR_ACF_FIELD',
'value' => date('Ymd'),
'compare' => '