• Resolved chrislondon

    (@chrislondon)


    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!

    • This topic was modified 5 years, 10 months ago by chrislondon.
    • This topic was modified 5 years, 10 months ago by chrislondon.
Viewing 2 replies - 1 through 2 (of 2 total)
  • [events_list] markup is taken from Events > Settings > Formatting > Default event list format, so simply wrap a div around that.

    If you’re using [events_list]Here some content[/events_list], the event list will use the settings (scope, order, etc) from the settings, but anything between the shortcode tags overwrites the default content.

    Thread Starter chrislondon

    (@chrislondon)

    Ah, I see. Thanks. That fixes it for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘events_list_grouped shortcode – wrap each group in a div’ is closed to new replies.