WordPress.org

Ready to get started?Download WordPress

Forums

My Calendar
[resolved] Upcoming events shortcode (2 posts)

  1. Twentyfourten
    Member
    Posted 1 year ago #

    I am using upcoming events widget in sidebar but also using upcoming events shortcode in a page.

    My shortcode is as follows:

    [my_calendar_upcoming before="0" after="3" type="event" fallback="No events coming up!" category="" author="" template="{date} {location}" order="asc" show_today="yes" skip="0"]

    This behaves as I'd expect, and outputs an unordered list item with the date and location data only.

    However, as soon as I add any before and after attributes to my template tags like so;

    [my_calendar_upcoming before="0" after="3" type="event" fallback="No events coming up!" category="" author="" template="{date before="<strong>" after="</strong>"} {location}" order="asc" show_today="yes" skip="0"]

    I get an unordered list output of;
    date - title </br>
    time, Category

    Why does this happen? It is not picking up this output from my sidebar widget as tags are not same, it seems to be defaulting to some other template?

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

  2. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    You've got a quotes nesting issue. Since you're using double quotes within the template attribute value, and using double quotes to delimit that value, the shortcode parser can't read the template, and throws it away.

    Instead of

    template="{date before="<strong>

    You need

    template='{date before="<strong>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.