Support » Plugin: My Calendar » Get current event

  • Resolved alexnl

    (@alexnl)


    I need to get the current event. At the moment it outputs all events for the day.

    Here is my shortcode so far:

    <?php echo do_shortcode('[my_calendar format="list" above="none" below="none" time="day" before="0" after="0" type="event" fallback="No events coming up!" template="{title before="<h4>" after="</h4>"} {time after="-"} {endtime} {image} {host} {description}" order="asc" skip="0"]'); ?>

    You’ll see the results if you visit this page and scroll down. The events show up under the date on the right-hand sidebar. http://www.radioherzclub.com

    Also {host} is not working, although each event has a host set.

    http://wordpress.org/plugins/my-calendar/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Joe Dolson

    (@joedolson)

    The host shortcode shows the display_name; if there is no display_name, it’ll be blank. But the shortcode should work if that is set.

    My Calendar doesn’t have a specific method to show what event is happening right now – if I were to consider adding such a thing, what would you expect it to show if there were no event happening?

    With the shortcode you’re supplying, you won’t necessarily get the results you’re expecting – you’re mixing and matching attribute between different shortcodes. The “before” and “after” attributes, for example, have no meaning at all in the [my_calendar] shortcode; they’re only used in the [my_calendar_upcoming] shortcode. This is all documented on the Help page, so you may want to review the Help notes on shortcodes.

    Thread Starter alexnl

    (@alexnl)

    Got it. Thanks for getting back to me. I’ll check the display_name on the users I added as hosts.

    If there is no current event it could just offer a notice like “there is no current event” and/or you could have it show the next upcoming event with a title saying “upcoming”.

    One other question, is there a way to add multiple hosts, when more than one person is hosting the event?

    Thanks!
    Alex

    Plugin Author Joe Dolson

    (@joedolson)

    No, I’m afraid not – although that might not be too difficult to add. I’ll think about it – nobody has ever requested it before.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get current event’ is closed to new replies.