In the comments section of Events grouped by months within years based on event date custom field value tutorial, a member asked:
... A good update for this would be a single loop of just MONTH YEAR with the events under each Month and Year, rather than YEAR, then MONTh then events.
This Pro tutorial is another example of custom advanced Bricks query loop types for showing future posts of event
CPT based on a date custom field using three nested query loops.
The Heading element's text is dynamic and automatically pulls data from the Event Year and Event Month query loop objects.
Similarly, the Post Loop pulls the year and month from the parent queries, passes them to a custom function which returns the IDs of posts from that year and and that month.
Events list:
Output on the front end after implementing the tutorial:
Step 1
Add the following in child theme's functions.php
(w/o the opening PHP tag) or a code snippets plugin:
This is a BricksLabs Pro tutorial.
For full access login below or create your BricksLabs Pro account