My Calendar has two primary methods for displaying events: Shortcodes and Widgets.
Shortcodes are small pieces of code intended to be placed in posts or pages. Some examples of using shortcodes are, adding a standard grid-format calendar, a list-formatted calendar, showing the events for the month, the week, or the day. Continue reading below to learn more about shortcodes.
Widgets are a convenient method to add information to sidebars and footer areas. Using widgets one can display a version of the calendar formatted for small spaces (the “mini” calendar), a list of upcoming events, a list of events happening today, or a specific single event. To learn more about widgets read our My Calendar widget documentation.
Located on the bottom of the default “My Calendar” page is the My Calendar Display Options meta boxes. (Click the top right arrow of the meta boxes to view the options.)
Main Calendar Shortcode
The default shortcode for displaying My Calendar.
The above my calendar code is actually the same as this code:
[my_calendar category="all" ltype="" lvalue="" format="calendar" above="" below="" time="month" author="all" host="all" id="" tem- plate="" year="" month="" day="" search=""]
Categories to display.
Location filter type by
All locations, Location Name, City, State, Postal Code, Country or Region.
Location filter values.
Search keyword. – Only events that use the keyword will be visible in the calendar.
Navigation keywords that can be used separated by commas in the “Navigation above calendar” and “Navigation below calendar” fields.
toggle – Switch between list and grid views
timeframe – Toggle between day, week, and month view
jump – Jump to any other month/year
nav – Primary Previous/Next Buttons
calendar – The calendar
key – Categories
print – Link to printable view
feeds – iCal Subscription Links
exports – iCal Subscription Links
locations – Location (dropdown)
categories – Categories (dropdown)
access – Access (dropdown)
search – Search
The attributes will show up in the order they are listed.
To remove the navigation add “none”.
My Calendar will show the defaults if no attributes are added.
Defaults can be configured in the Settings > Output screen.
Author & Host Filters
Limit by Author.
Limit by Host.
Formatting & Timeframe
Format by Default, Grid, List or Mini.
Time Segment by Default, Month, Next Month, Week or Day.
Months to show in list view.
Initial Date Shown
Select the start date of events going forward.
Year by Default or the next 5 years.
Month by Default or a specific month.
Day by Default or from 1 to 31.
Example Customized Shortcode
[my_calendar above="toggle, nav" below="print, key" format="list" time="week"]
Above calendar: A toggle between list/grid view along with nav previous/next navigation arrows.
Below calendar: a print icon and key categories.
Format: Changed the default grid to list.
Time: The calendar is seen in a week view.
The result which includes two events is seen on the frontend of the site.
Reset Shortcode button
Go back to the backend and click the “Reset Shortcode” button (to the right of the Shortcode field) and refresh the browser window to see the Shortcode field reset.
Read about the Shortcode Generator.
Next: My Calendar > Shortcodes.