Max / Super Loopers / Custom Events Calendar Lesson

Hi,

I really appreciate the inclusion of the Custom Events Calendar lesson in the SuperLoopers Max course. I understand that it probably falls into the territory of custom coding, which is outside of the Theme.co Support Team scope. However, I suppose Max is made for learning. And I would appreciate it if you could explain how to expand that further in the following respect.

Let’s say we need to use different custom functions in different places on our site. We can display upcoming events from our Custom Post Type in one section and create another section on the same archive page, or create a separate archive page just for the past events. I have an idea to modify the code from the lesson to make the filter perform the second task. But I’m curious how to make a specific Container / Element or even stand-alone Archive Page use different functions for the same ACF data we have.

Could you please explain the mechanics for doing that inside Cornerstone? That would be a great help for the learning curve of inexperienced users in coding, like me. Thank you in advance.

Hello @referee,

Thanks for writing to us.

You can use the Looper to display the event. I would suggest you please set the Looper provider as a query builder and set the post type as Event. You need to set the meta query as well. You need to set the meta key as mec_start_date, and the meta value would be {{dc:global:date format=“Y-m-d”}}. Please have a look at the screenshot below.

In case you want to create an archive page for the event, please use the layout builder to create a custom layout for the event archive page. Please have a look at this doc to learn more about how to create an archive page.



Hope it helps
Thanks

Dear @prakash_s,

Thank you for the guideline. I tested that out, but instead of mec_start_date I used event_start_date as the meta key as we deal with the Custom Post Type and not MEC plugin in that Max Lesson.

I began with a recreation of the first example to display all events from today onward, but it didn’t work. The query builder doesn’t cut off the first event whose date has already passed. I also tried to show all passed events, and it didn’t work with the “less than” sign as well.

Hello @referee ,

Thank you for correcting the meta key. It seems there might still be an issue with the comparison. I recommend checking how the event_start_date meta key value is stored. You can retrieve the meta key value using the dynamic content code to verify it, and then adjust the global date format accordingly based on what you find. Please have a look at this doc to learn more about the date format https://wordpress.org/documentation/article/customize-date-and-time-format/

If it doesn’t work for you, 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

@prakash_s it seems like the quotation marks caused the issue when I copied the string for the date format from your initial post. The string only started to work after I manually rewrote it inside the Meta Value field for today’s date. There were different symbols for double quotation marks, I guess. I will investigate it further tomorrow.

Thank you for your guidance.