Shortcode & block

Calendar ·4 min read ·Updated August 2026
You're here because

you want the exact shortcode syntax, the block equivalent, and the URLs the calendar navigates with.

The calendar ships as both a shortcode and a Gutenberg block. The block is dynamic: its markup is produced by the same server-side renderer the shortcode uses, so the two can never drift apart, and a calendar always reflects your events as they are today rather than as they were when the page was saved.

The shortcode

[venuera_calendar view="month" category="" show_past="no" max_events="12"]

Every attribute is optional; the values above are the defaults. Some working examples:

  • [venuera_calendar] – the month grid, current month, all categories.
  • [venuera_calendar view="list" max_events="5"] – the next five events, for a sidebar.
  • [venuera_calendar view="week" category="concerts,club-nights"] – this week, two categories only.
  • [venuera_calendar show_past="yes"] – an archive calendar including finished dates.
  • [venuera_calendar max_events="2"] – a tidy month grid: two events per day, the rest behind “+N more”.

The block

Search the inserter for Venuera Calendar. The inspector carries the same four options, with two conveniences the shortcode cannot offer:

  • Categories are a real multi-select built from your event categories, so there are no slugs to type or misspell. Categories with no published events are still listed, so you can build a page ahead of announcing its programme.
  • A live preview renders in the editor exactly as it will on the front end.

Behind the scenes the block stores the category as the same comma-separated slug string the shortcode uses, so switching between the two is lossless.

Every state has a URL

Moving through the calendar is plain links, not JavaScript. The previous, next and Today controls, the view switch, the category dropdown and the past-events toggle all navigate by adding query variables to the current page:

  • ?vcm=YYYY-MM – the month on show.
  • ?vcm_date=YYYY-MM-DD – the anchor date for the week view.
  • ?vcm_view=month|week|list – the active view.
  • ?vcm_cat=slug – the chosen category. Present but empty means the visitor picked All.
  • ?vcm_past=1 – include past events.

That has three practical consequences: a visitor can bookmark or share “March, concerts only”, the browser back button behaves, and the calendar renders in full for a crawler or a text browser before a single script has run. The front-end script only adds what genuinely needs it – the hover card and the “+N more” toggle.

Multiple calendars: the query variables apply to the page, so keep one interactive calendar per page. A second calendar on the same page is fine as a fixed “coming up” list, but both will respond to the same navigation.