Using Sugar Calendar Events Shortcodes

This tutorial covers how to use every Sugar Calendar Events shortcode and the attributes each one accepts.


Heads up! This tutorial contains PHP code and is intended for developers. We offer this code as a courtesy but don’t provide support for code customizations or 3rd party development.

Before you get started, make sure Sugar Calendar Events is installed and activated on your site.

Available Shortcodes

ShortcodeWhat it shows
Days of the Week
Time of Day
Month
Week
Day
MonM
TueT
WedW
ThuT
FriF
SatS
SunS
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
A calendar with month, week, and day views
Days of the Week
Time of Day
List
Grid
Plain
There are no events scheduled this week.
A list of upcoming events
The ticket purchase receipt
The details for a single ticket

November 2026

MondayTuesdayWednesdayThursdayFridaySaturdaySunday
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
and

There are no upcoming events to display.

The legacy calendar and events list

The calendar and events list shortcodes show the same output as the Sugar Calendar blocks, and they accept the same settings as attributes.

Adding a Shortcode

Paste the shortcode into a Shortcode block, a Classic editor, a text widget, or your page builder’s shortcode element. To build a shortcode without typing it, use the Shortcode Generator in the Classic editor.

To add attributes, put each one after the shortcode name with its value in quotes:

[sugarcalendar_events_list display="grid" maximum_events_to_show="6" group_events_by_week="false"]

Keep these rules in mind:

  • Attribute names use underscores, such as featured_only. The camelCase names from the block, such as featuredOnly, don’t work in a shortcode.
  • Yes or no attributes take true or false.
  • ID attributes take one ID or several IDs separated by commas, such as calendars="3,7".
  • Sugar Calendar Events ignores attributes it doesn’t recognize, including misspelled names and values that aren’t on the list of options. The shortcode then uses the default without showing an error.

To show a shortcode in a PHP template, pass it to do_shortcode():

echo do_shortcode( '[sugarcalendar_events_calendar display="week"]' );

Finding Calendar, Tag, Venue, and Speaker IDs

The filter attributes take IDs, not names. To find an ID, go to the screen below and hover over the item’s name.

Accessing venue ID

The ID is the number at the end of the link that appears at the bottom of your browser.

ItemWhere to find itThe ID in the link
CalendarEvents » Calendarscalendar_id=3
TagEvents » Tagstag_id=7
VenueEvents » Venuespost=410
SpeakerEvents » Speakerspost=526

Note: Venues and speakers need Sugar Calendar Events Pro.

Events Calendar Shortcode

The

Days of the Week
Time of Day
Month
Week
Day
MonM
TueT
WedW
ThuT
FriF
SatS
SunS
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
shortcode shows a calendar of your events. Without attributes, it shows the current month with every event.

Days of the Week
Time of Day
Month
Week
Day
Mon
M
23
Tue
T
24
Wed
W
25
Thu
T
26
Fri
F
27
Sat
S
28
Sun
S
29
All Day
Multi-day
12:00 AM
1:00 AM
2:00 AM
3:00 AM
4:00 AM
5:00 AM
6:00 AM
7:00 AM
8:00 AM
9:00 AM
10:00 AM
11:00 AM
12:00 PM
1:00 PM
2:00 PM
3:00 PM
4:00 PM
5:00 PM
6:00 PM
7:00 PM
8:00 PM
9:00 PM
10:00 PM
11:00 PM
AttributeValuesDefaultWhat it does
displaymonth, week, daymonthSets the view the calendar opens in.
calendarsCalendar IDsAll calendarsShows only events from these calendars.
tagsTag IDsAll tagsShows only events with these tags.
venuesVenue IDsAll venuesShows only events at these venues. Needs Pro.
speakersSpeaker IDsAll speakersShows only events with these speakers. Needs Pro.
featured_onlytrue, falsefalseShows only featured events.
show_block_headertrue, falsetrueShows the header with the date controls, view switcher, filters, and search.
allow_user_change_displaytrue, falsetrueLets visitors switch between the month, week, and day views.
show_filterstrue, falsetrueShows the filters button.
show_searchtrue, falsetrueShows the search field.
appearancelight, darklightSets the light or dark color scheme.
accent_colorA hex color code#5685BDSets the color of buttons and highlights.
idAny textGeneratedSets the HTML id of the calendar, so you can target it with CSS or JavaScript.

For examples of each attribute, see our guide to displaying the calendar.

Events List Shortcode

The

Days of the Week
Time of Day
List
Grid
Plain
There are no events scheduled this week.
shortcode shows a list of your upcoming events. Without attributes, it shows the events for the current week, with buttons to move between weeks.

[sugarcalendar_events_list group_events_by_week="false" maximum_events_to_show="20" events_per_page="5"]
AttributeValuesDefaultWhat it does
displaylist, grid, plainlistSets the layout of the list.
group_events_by_weektrue, falsetrueShows the events one week at a time. Set it to false to show the next upcoming events instead.
maximum_events_to_showA number10Sets the total number of events in the list.
events_per_pageA number10Sets the number of events on each page of the list.
calendarsCalendar IDsAll calendarsShows only events from these calendars.
tagsTag IDsAll tagsShows only events with these tags.
venuesVenue IDsAll venuesShows only events at these venues. Needs Pro.
speakersSpeaker IDsAll speakersShows only events with these speakers. Needs Pro.
featured_onlytrue, falsefalseShows only featured events.
show_block_headertrue, falsetrueShows the header with the date controls, view switcher, filters, and search.
allow_user_change_displaytrue, falsetrueLets visitors switch between the list, grid, and plain layouts.
show_filterstrue, falsetrueShows the filters button.
show_searchtrue, falsetrueShows the search field.
show_date_cardstrue, falsetrueShows the date card next to each event.
show_descriptionstrue, falsetrueShows each event’s description.
show_featured_imagestrue, falsetrueShows each event’s featured image.
image_positionright, leftrightSets the side the featured image appears on.
appearancelight, darklightSets the light or dark color scheme.
accent_colorA hex color code#5685BDSets the color of buttons and highlights.
links_colorA hex color code#000000D9Sets the color of the event titles and links. With appearance="dark", the default is white.
idAny textGeneratedSets the HTML id of the list, so you can target it with CSS or JavaScript.

Note: The maximum_events_to_show and events_per_page attributes only apply when group_events_by_week is false. If events_per_page is higher than maximum_events_to_show, the list uses the maximum instead.

The events list shortcode doesn’t have a category attribute. To filter by calendar, use calendars with calendar IDs.

For examples of each attribute, see our guides to displaying event lists and displaying upcoming events.

Combining Filters

When you list several IDs in one attribute, the shortcode shows events that match any of them. For example, calendars="3,7" shows events from either calendar.

When you use more than one filter attribute, events have to match all of them. This shortcode shows only featured events from calendar 3 at venue 410:

Days of the Week
Time of Day
List
Grid
Plain
There are no events scheduled that match your criteria.

Ticketing Shortcodes

The

and shortcodes power the ticket pages that buyers see after checkout. They don’t take any attributes. Each one reads the order and ticket from the page’s URL.

ShortcodePage
The receipt page that buyers see after they pay
The page for a single ticket, opened from the receipt

Sugar Calendar Events creates both pages for you. To choose different pages, go to Events » Settings » Payments and use the Tickets Page Configuration section. If you build your own page, add the matching shortcode to it.

Legacy Shortcodes

The

November 2026

MondayTuesdayWednesdayThursdayFridaySaturdaySunday
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
and

There are no upcoming events to display.

shortcodes come from older versions of Sugar Calendar Events. They still work, but they use the legacy design and don’t support the newer attributes. We recommend switching to
Days of the Week
Time of Day
Month
Week
Day
MonM
TueT
WedW
ThuT
FriF
SatS
SunS
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
and
Days of the Week
Time of Day
List
Grid
Plain
There are no events scheduled this week.
.

Legacy Calendar Attributes

AttributeValuesDefaultWhat it does
typemonth, week, 2week, 4day, daymonthSets the calendar view.
sizelarge, smalllargeSets the calendar size.
categoryA calendar slugAll calendarsShows only events from this calendar.
month1 to 12The current monthSets the month the calendar opens in.
yearA year, such as 2027The current yearSets the year the calendar opens in.
sow0 to 6The site’s settingSets the first day of the week, where 0 is Sunday and 1 is Monday.

Legacy Events List Attributes

AttributeValuesDefaultWhat it does
displayupcoming, past, in-progress, allupcomingSets which events the list shows.
numberA number5Sets the number of events.
orderASC, DESCASC, or DESC for past eventsSets the sort order by start date.
categoryCalendar slugsAll calendarsShows only events from these calendars. Separate several slugs with commas.
show_datetrueOffShows each event’s date.
show_timetrueOffShows each event’s time.
show_categoriestrueOffShows each event’s calendars.
show_linktrueOffShows a Read More link to each event.

Frequently Asked Questions

These are answers to some of the top questions we see regarding using shortcodes on Sugar Calendar Events.

Why does my attribute have no effect?

Check the spelling first. Sugar Calendar Events ignores attribute names and values it doesn’t recognize, so a typo such as show_filter or a block name such as showFilters falls back to the default without an error.

Also check that you’re using the attribute with the right shortcode. For example, category only works with the legacy shortcodes, and show_date_cards only works with the events list.

Can I change the default attributes for every shortcode?

Yes. The sugar_calendar_shortcodes_modern_shortcodes_attributes_sugarcalendar_events_calendar and sugar_calendar_shortcodes_modern_shortcodes_attributes_sugarcalendar_events_list filters let you change the attributes before each shortcode renders. This example makes every events list use the grid layout unless the shortcode sets display:

add_filter(
	'sugar_calendar_shortcodes_modern_shortcodes_attributes_sugarcalendar_events_list',
	function ( $attributes, $shortcode_attributes ) {
		if ( empty( $shortcode_attributes['display'] ) ) {
			$attributes['display'] = 'grid';
		}

		return $attributes;
	},
	10,
	2
);

The $attributes array uses the block’s camelCase names, such as display and featuredOnly. To learn where to add this code, see our tutorial on getting started with Sugar Calendar hooks.

That’s it! You now know how to use every shortcode and attribute in Sugar Calendar Events.

Next, would you like to read event details in your own code? Check out our guide to accessing event data in Sugar Calendar Events.