events_list_grouped shortcode – wrap each group in a div
-
Hi. Events Manager includes a really useful shortcode so you can list events grouped according to various criteria. My problems is I want to wrap each group in its own separate div. I’m sure there must be an easy way to do that by editing the events-list-grouped.php template. Can anyone help?
Here’s my example.
At the moment, I’m grouping my events by date, with a limit to up to 4 events. So the output looks like this:
<h2>1 February 2019</h2> <p>6pm</p> <p><a href="#">Event name</a></p> <h2>2 February 2019</h2> <p>6pm</p> <p><a href="#">Event name</a></p> <p>9pm</p> <p><a href="#">Event name</a></p> <h2>3 February 2019</h2> <p>6pm</p> <p><a href="#">Event name</a></p>
What I’d like is this:
<div> <h2>1 February 2019</h2> <p>6pm</p> <p><a href="#">Event name</a></p> </div> <div> <h2>2 February 2019</h2> <p>6pm</p> <p><a href="#">Event name</a></p> <p>9pm</p> <p><a href="#">Event name</a></p> </div> <div> <h2>3 February 2019</h2> <p>6pm</p> <p><a href="#">Event name</a></p> </div>
You can format the HTML between the opening and closing shortcodes. That will allow to you wrap each event in its own div – but I want to wrap each group in its own div.
Any ideas?
Thanks!
- The topic ‘events_list_grouped shortcode – wrap each group in a div’ is closed to new replies.