• Resolved Alison8

    (@alison8)


    Is there conditional shortcode, or any way, to identify the final event shown in a list?

    I use the event builder to display my events in a list, and I wanted a small amount of space between each event in the list, so at the end of all of the event builder code, I added a <br>. This works great, except I don’t need a break after the final event in the list, since there are no following events and it just creates unnecessary extra space.

    Is there a way, in the event builder, to only have the break used after all events EXCEPT for the final event in the list? Or is there some other way to get after what I’d like to do? That is, have a small amount of space (just a break – or even less) between each event, but not after the last event listed?

    Thanks for the help!

    https://www.ads-software.com/plugins/google-calendar-events/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Nick Young

    (@nickyoung87)

    There is not a shortcode to check for the last item in a list right now. Another idea would be to mess with the CSS. Maybe setting the margin above/below the list items a little higher would fork for you.

    Thread Starter Alison8

    (@alison8)

    Hi Nick,

    Thanks for getting back to me so quickly. The CSS modification is a good suggestion. My calendar list lives in a widget on a sidebar, between other widgets. Via my theme, I can (and have) adjusted the padding between each widget. But I didn’t think I could adjust the padding/margin for a single widget. If I could, though, I could just keep the breaks and decrease the padding at the end of the calendar widget, which would essentially produce the same space between each widget on the page…

    Or are you suggesting that I can set the margins above/below each list item within the calendar list? If so, how would I go about doing that? I’ve only ever modified CSS for a theme, not a specific plugin, so it’s not something I’m familiar with. But if it’s possible, it definitely sounds like it would solve the problem.

    Thanks for your assistance!

    Plugin Contributor Nick Young

    (@nickyoung87)

    Yeah if you just inspect the elements you can add the styles for those in your theme stylesheet. For this particular instance you might be able to start by trying .gce-feed.

    Thread Starter Alison8

    (@alison8)

    Ah okay, great. I ended up adjusting the margin of .gce-event-day and it did what I wanted. Thank you for the help!

    Plugin Contributor Nick Young

    (@nickyoung87)

    Glad that it worked for you ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conditional shortcode for final event in a list?’ is closed to new replies.