I see.. The above example in twig is similar in concept to the other links – basically to output a header for the first occurrence of each date. That would work for grouping by individual days, but not months.
This is a tough one. I think the field values (start date) need to be parsed, to extract the months – then, to display a heading for first occurrence of each month.
Here’s how I imagine it working like:
[loop type="events" orderby="field" field="start_date" group="month"]
[if month] {YEAR} / {MONTH} [/if]
Event: [field title] from [field start_date]
[/loop]
The parameter group could be set to day, month, year or – say, value, which would group by the whole field value..
One issue could be, that the heading can only display the month number. I suppose there could be a conditional like:
[if month="1"] {YEAR} January [/if]
..but you’d have to code all 12 months.
So, it will not be so simple to do.
Interestingly, there was another recent request of similar complexity – sorting by multiple custom fields. WP_Query doesn’t cover it – same with grouping by fields – and it’s tough to come up with a good solution.