Displaying the Calendar

The calendar of events can be displayed in several ways:

  • Using the short code: [sc_events_calendar]
  • Using the Event Calendar widget
  • Using the template tag: sc_get_events_calendar()

Using the Short Code

The [sc_events_calendar] short code will show a complete ajax enabled calendar of your events wherever you place the short code. The best place is on a page, such as one named "Events Calendar".

The short code accepts two optional parameters:

  1. category - this will allow you to limit the calendar to only show events from one category/calendar.
  2. size - this allows you to display a large or small calendar. A large calendar is default.

Using the short code like the example below will show a large calendar with all categories (non excluded):

The short code example below will show only the "social" category and will display the small calendar:
[sc_events_calendar category="social"size="small"]

The shortcode also accepts a type parameter that allows you to control the date range displayed. The accepted values are:

  • month
  • day
  • 4day
  • week
  • 2week

For example, to show a calendar that displays one week at a time, use:

[sc_events_calendar type="week"]

To show a calendar that displays two weeks at a time, use:

[sc_events_calendar type="2week"]

Note: If no type parameter is specified, month will be used by default.

Using the Event Calendar Widget

This widget will allow you to show event calendars that display all events, calendars that show only a specific category, and also both large and small calendars.To use the widget, first go to Appearance > Widgets, then drag "Event Calendar" to the widget area you wish to display a calendar. Once the widget is placed, choose the size and category to show. If you don't want the calendar limited to a specific category, then choose "All".

Using the Template Tag

This option is for advanced users who wish to modify their theme's template files in order to show the calendar(s).

To show a calendar, you can use this:

echo sc_get_events_calendar();
The sc_get_events_calendar() function accepts to optional parameters:
  • $size = 'large'
  • $category = null
  • $type = 'month'

You can use the $size parameter to display either a "small" or "large" calendar.

You can use the $category parameter to show a calendar with events only from specified categories. The $category parameter can be a comma separated string of IDs or slugs, or an array of IDs or slugs.

Note: In order to get the frontend styles and scripts to properly enqueue, you'll need to include these two functions in your template: