Shortcodes
Shortcodes
Use shortcodes to display events in posts, pages, and widget areas. Shortcodes work in classic editor, text widgets, and anywhere shortcodes are processed.
Available shortcodes
| Shortcode | Description |
|---|---|
[emwc_calendar] | Interactive event calendar |
[emwc_events] | Event list or grid |
[emwc_upcoming] | Compact upcoming events list |
Calendar shortcode
Display an interactive calendar with your events.
Basic usage
[emwc_calendar]
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
view | month, list | month | Initial calendar view |
category | slug | - | Filter by category slug |
show_navigation | yes, no | yes | Show prev/next buttons |
show_today | yes, no | yes | Show Today button |
Examples
Month view with specific category:
[emwc_calendar category="workshops"]
List view without navigation:
[emwc_calendar view="list" show_navigation="no"]
Events shortcode
Display events in grid or list layout.
Basic usage
[emwc_events]
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
limit | 1-50 | 12 | Number of events |
columns | 1-4 | 3 | Grid columns |
layout | grid, list | grid | Display style |
category | slug | - | Filter by category |
featured | yes, no | no | Featured events only |
show_image | yes, no | yes | Display thumbnails |
show_date | yes, no | yes | Display dates |
show_venue | yes, no | yes | Display venues |
show_excerpt | yes, no | yes | Display descriptions |
order | ASC, DESC | ASC | Sort direction |
orderby | date, title | date | Sort field |
past | yes, no | no | Include past events |
Examples
Six events in two columns:
[emwc_events limit="6" columns="2"]
Featured events only:
[emwc_events featured="yes" limit="4"]
List view of workshops:
[emwc_events layout="list" category="workshops"]
Past events for archive:
[emwc_events past="yes" order="DESC"]
Minimal display:
[emwc_events show_image="no" show_excerpt="no"]
Upcoming events shortcode
Compact list for sidebars and small spaces.
Basic usage
[emwc_upcoming]
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
limit | 1-20 | 5 | Number of events |
category | slug | - | Filter by category |
show_image | yes, no | no | Display thumbnails |
show_date | yes, no | yes | Display dates |
show_venue | yes, no | yes | Display venues |
Examples
Ten upcoming events:
[emwc_upcoming limit="10"]
Events with thumbnails:
[emwc_upcoming show_image="yes"]
Specific category:
[emwc_upcoming category="webinars"]
Using shortcodes
In classic editor
- Place cursor where you want events
- Type the shortcode
- Preview or publish
In Gutenberg
- Add a Shortcode block
- Enter the shortcode
- Preview shows output
In widgets
- Add a Text widget
- Enter the shortcode
- Save widget
In theme templates
<?php echo do_shortcode( '[emwc_events limit="4"]' ); ?>
Category slugs
Find category slugs at Events > Event Categories. The slug appears in the URL column or when editing a category.
Common slugs:
- workshops
- conferences
- webinars
- meetups
Combining options
Mix attributes for specific needs:
Homepage featured events:
[emwc_events featured="yes" limit="3" columns="3"]
Sidebar webinars:
[emwc_upcoming category="webinars" limit="5"]
Full archive page:
[emwc_events limit="50" past="yes" order="DESC"]
Minimal event list:
[emwc_events show_image="no" show_excerpt="no" show_venue="no"]
Styling
CSS classes
Shortcode output uses these classes:
/* Calendar */
.emwc-calendar {
}
.emwc-calendar-month {
}
.emwc-calendar-list {
}
/* Events */
.emwc-events {
}
.emwc-events-grid {
}
.emwc-events-list {
}
.emwc-event-card {
}
/* Upcoming */
.emwc-upcoming-events {
}
.emwc-upcoming-item {
}
Custom styling
Add CSS in your theme or Customizer:
/* Larger event titles */
.emwc-event-card h3 {
font-size: 1.5em;
}
/* Different grid gap */
.emwc-events-grid {
gap: 30px;
}
Troubleshooting
Shortcode shows as text
- Verify plugin is active
- Check for typos in shortcode
- Ensure shortcodes are enabled in the context
No events display
- Check events are published
- Verify category slug if filtering
- Check date range (past events hidden by default)
Wrong number of events
- Confirm
limitattribute - Check for conflicting CSS hiding elements
Layout issues
- Verify
columnsvalue for grid - Check theme CSS conflicts
- Test in default theme