Shortcode Options
Pie Calendar’s calendar view is displayed by using the shortcode below.
➔ Using the Block Editor?
You can now add and customize your Pie Calendar with our new block, no shortcode needed!
Learn more: https://docs.piecalendar.com/article/71-block-editor-support
[piecal]
This shortcode accepts a few parameters:
view: The default view for the calendar. Possible values are: dayGridMonth, listMonth, timeGridWeek, listWeek, dayGridWeek, or listDay.
[piecal view="listMonth"]
duration: As of Pie Calendar v1.3.8, you can use the duration attribute to show upcoming events across multiple months. This is especially helpful if you only have a few events per year and want to show all of them at once.
The duration attribute is only supported in the listUpcoming and listMonthWithFeaturedImage views.
If you want to show events over the next 6 months with their featured image in a beautiful list view, you can use this shortcode:
[piecal view="listMonthWithFeaturedImage" duration="6"]
Or, use the more compact list view, showing events over the next 12 months:
[piecal view="listUpcoming" duration="12"]
Simply change the duration value to the number of months you want to display, up to a maximum of 24.
Both of these views and the duration control are directly supported in the block controls.
See a demo video of this feature here >>
Note: The view "listMonthWithFeaturedImage" is only available in Pro.
locale: An ISO 639-1 language code. By default, the calendar will use the locale of your WordPress install, but if you want to specify a different locale, you can do it in this shortcode parameter.
[piecal locale="es"]
type: Specify a post type to show on the calendar. By default, all posts designated as an event will be shown. If you specify a post type, however, only events of that type will be shown on this instance of the calendar.
[piecal type="event"]
Video demonstration:
theme: Specify a preference for dark mode behavior. Possible themes are: dark, adaptive.
Dark forces the calendar into dark mode all the time.
Adaptive checks the user agent setting of "prefers-color-scheme" and adapts light/dark accordingly.
Important note: The adaptive option will adapt to the user's operating system color scheme preference, but this does not always mean that your theme will adapt. Using the adaptive theme can result in unreadable text in the calendar if your theme does not also adapt to the user's color scheme preference. Please test thoroughly when using theme="adaptive".
[piecal theme="adaptive"]
The wraptitles attribute is available in free version 1.1.1 and Pro version 1.2.1.
wraptitles: If the wraptitles attribute is included in the shortcode, events with long names will wrap rather than being obfuscated by the bounds of the event cell they belong to. While the value of the attribute isn't of particular consequence, we recommend setting it to 'true' for better readability.
[piecal wraptitles='true']
The widget attribute is available as of free version 1.2 and Pro version 1.2.1.
[piecal widget="true"] [piecal widget="responsive"]
Widget mode allows you to have a more functional mobile calendar with options to force the widget mode at all times, or only on smaller screen sizes.
Use the attribute [piecal widget="true"] to force your calendar into Widget mode all the time. This is useful for adding a calendar to your website sidebar, for example.
You also have the option to use [piecal widget="responsive"] and the calendar will change to widget mode when the users screen size is 768px or below.
Note: Widget mode only works with the default "Month - Classic" or "dayGridMonth" views.
The Event Info Shortcode
To display an event’s Pie Calendar start and end date, use the shortcode. It accepts the following parameters:
format: By default, the format output by the shortcode will match your WordPress site’s default date & time format. If you want to change it, you can output a specific format in this parameter.
Note that any non-format characters (e.g. letters you want to display as letters instead of converting to day/date/time, etc...) must be escaped with double backslashes.
For a full list of available date formatting characters, see the PHP DateTimeInterface Format documentation.
fragments: This allows you to determine which portions of the info shortcode are shown, acceptable values are: start
, end
, timezone
, all
, allday
. Pro users can also use the atc
fragment to show the Add To Calendar links on individual posts or omit this fragment to hide the links.
[piecal-info format="Ymd \\a\\r\\o\\u\\n\\d H:i:s" fragments="all"]
Automatic End Dates
As of free version 1.2.0 and Pro version 1.2.1
Events with no explicit end date now get an end date 1 hour from their start date by default. You can disable this with the automaticEndDates=false shortcode parameter.