WordPress.org

Support

Support » Plugins and Hacks » Simple Calendar - Google Calendar Plugin » Shortcode for events spanning multiple days that are all-day

Shortcode for events spanning multiple days that are all-day

  • Hi, I need help writing a shortcode combination. I would like to display events that span multiple days (I would like it to show the start and end dates only, if the events are listed as all-day events, and not display the start/end times. However, if the multi-day event has a specific start/end time, I would like to display it.

    For example, for a event with no start and end time, I would like it to display as:
    January 2, 2014 – January 5, 2014.

    But for an event WITH start/end times, I would like it to display as:
    February 2, 2014, 7:00 am – February 6, 2014, 9:00 pm

    I made up this shortcode, but it isn’t working:
    [if-multi-day]<div>[start-date][if-not-all-day], [start-time][/if-not-all-day] – [end-date][if-not-all-day], [end-time][/if-not-all-day]</div>[/if-multi-day]

    What have I done wrong?

    http://wordpress.org/plugins/google-calendar-events/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ross Hanney

    @rosshanney

    Hello,

    Apologies for the delayed reply.

    Sometimes the plugin gets confused with multiple shortcodes directly next to each other. Try separating them with line breaks. Like this, for example:

    [if-multi-day]
    <div>
    [start-date]
    [if-not-all-day], [start-time][/if-not-all-day] -
    [end-date]
    [if-not-all-day], [end-time][/if-not-all-day]
    </div>
    [/if-multi-day]

    If that’s still not working, let me know.

    Hi, thank you so much for your help! (For a free plugin, I have no right to complain about response time =) You are excellent!)

    Unfortunately, the solution you offered didn’t work. I tried your code, and applied it to two different pages: http://wordpress.lebanonbfc.org/ (at the bottom, under ‘Upcoming Events’), and also here: http://wordpress.lebanonbfc.org/calendar-4/

    With the changes you suggested, now I don’t see any times for any events.

    Any other code combinations to try?

    oops, I made a mistake in typing the code. Let me try that again…

    Your solution worked! Thanks a ton!

    Also, I don’t know where ‘future feature requests go’, but if you would consider it, I would love if the plugin displayed event names and times in the grid view, just like embedding a Google calendar the traditional way does. That would make your plugin PERFECT.

    Already, though, your plugin is better than the old-way of embedding because it is 1. Responsive, and 2. matches my page’s color scheme/look/feel. Keep up the good work.

    Thanks again!

    Hi There

    I think I am running into the same problem, but inserting line breaks is not resolving the issue.

    My event is a multi-day event with specific start time and end time, Fri, January 17, 7:00pm – Sat, January 18, 3:30pm.

    The following is my code:

    <div class="ue-date">
    	[start-date]
    	[if-multi-day]
    	- [end-date]
    	[/if-multi-day]
    </div>

    The markup it renders is:

    <div class="ue-date">
    	Fri, Jan 17
    
    </div>

    It seems that the issue occurs because the duration of the event is less than 24 hours. When I the event duration to Fri, January 17, 7pm – Sat, January 18, 9pm, the expected markup for the end date is rendered.

    <div class="ue-date">
    	Fri, Jan 17
    
    	- Sat, Jan 18
    
    </div>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Shortcode for events spanning multiple days that are all-day’ is closed to new replies.
Skip to toolbar