The Google Calendar Events plugin can easily be displayed to any page or post by using a simple shortcode. To do this you will need to use the [gcal]
shortcode. There are also a few options you can use to customize the output using attributes.
Shortcode Attributes
Below are the available attributes for this shortcode.
Attribute | Description | Choices |
---|---|---|
id | The ID of the Feed you created in the admin section. You can add multiple feed IDs separated by a comma. This is required. | A valid feed ID |
display | How you want to display your calendar. | grid, list, grouped-list |
order | The sort order for list based displays. | asc, desc |
title | The title to display on the popup box for your events. | Any text |
paging | Determines whether back/next buttons are shown for the calendar. | true, false |
interval | The type of interval to use for the calendar. List view only. | days, events |
interval_count | The number of items to show for the selected interval. E.g. 7 with "days" will show 7 days worth, while 7 with "events" will show the next 7 events. List view only. | Any number |
offset_interval_count | The count to use for the start offset based on the interval. List view only. | Any number |
offset_direction | The direction for the offset. List view only. | back, forward |
show_tooltips | This option will show the tooltips that show up when hovering over an event on grid view. | true, false |
Note: All shortcode attribute default values will come from the Feed Settings.
Note: Any shortcode attributes will overwrite any specific feed settings for that attribute.
Note: Sort order only applies to list based displays.
Shortcode Examples
Output a calendar with the ID of 123 using the Feed Settings:
[gcal id="123"]
Output a list view showing only 15 events:
[gcal id="123" interval="events" interval_count="15" display="list"]
Output a list with an offset of 5 days back:
[gcal id="123" display="list" interval="days" offset_interval_count="5" offset_direction="back"]
Output a calendar with multiple feeds:
[gcal id="123, 125, 127, 129"]