Skip to content
slimndap edited this page Sep 3, 2014 · 48 revisions

Theatre comes with several shortcodes which can be used to insert content inside posts and pages.

Event listing

Lists all upcoming events:

[wpt_events]

Arguments

  • paginateby {day, month and/or category} Paginate by day, month and/or category. If set a day, month and/or category navigation is added to the top of the listing. Default <empty>.
  • groupby {day, month or category} Group by day, month or category. If set a day, month or category header is added at the start of each group. Default <empty>.
  • limit {number} The maximum number of events to show. No maximum when left empty.
  • production {number} The ID of a production. Only show events that belong to a particular production. Default <empty>.
  • season {number} The ID of a season. Only show events that belong to aproduction of a particular season. Default <empty>.
  • category {string} An array of category names (slugs). Only show events that belong to a production within certain categories. Default <emtpy>.

Template

The event listing uses a template to generate the HTML for each event. The default template is:

{{thumbnail|permalink}} {{title|permalink}} {{remark}} {{datetime}} {{location}} {{tickets}}

It is possible to use your own template by using an enclosing shortcode:

[wpt_events]<h3>{{title}}</h3><p>{{datetime}}}<br />{{location}}</p>[/wpt_events]

Available fields:

  • {{categories}}
  • {{content}}
  • {{date}}
  • {{datetime}}
  • {{duration}}
  • {{excerpt}}
  • {{location}}
  • {{remark}}
  • {{thumbnail}}
  • {{tickets}}
  • {{time}}
  • {{title}}

To turn a field into a link, you can add a permalink filter to the placeholder:

{{title|permalink}}

By default, all dates are formatted using the date format setting in WordPress. To use another format, you can add a date filter to the placeholder:

{{datetime|date('D j')}}

Custom fields

If you added a custom field to the productions then you can also use this a a placeholder. To display a custom 'composer' field:

{{composer}}

More examples

Show all upcoming events, grouped by month:

[wpt_events groupby="month"]

Show all upcoming events, paginated by category:

[wpt_events paginateby="category"]

Show all upcoming events, paginated by category and month:

[wpt_events paginateby="category,month"]

Show all upcoming events, paginated by month and grouped by category:

[wpt_events paginateby="month" groupby="category"]

Show the first 10 upcoming events:

[wpt_events limit="10"]

Show events in the drama and music categories:

[wpt_events category="drama,music"]

Production event listing

Lists all upcoming events for a production:

[wpt_production_events]

Can be used on the page of a production.

Template

The event listing uses the same default template and fields as the regular event listing. You can use an enclosing shortcode to add your own template:

[wpt_production_events]{{remark}} {{datetime}} {{location}} {{tickets}}[/wpt_production_events]

Event ticket link

Display the ticket link for an event.

Arguments

  • id The ID of the event.

Example:

[wpt_event_ticket_button id="123"]

Production listing

Lists all productions:

[wpt_productions]

Arguments

  • paginateby {season and/or category} Paginate by season and/or category. If set a season and/or category navigation is added to the top of the listing. Default <empty>.
  • groupby {season or category} Group by season or category. If set a season or category header is added at the start of each group. Default <empty>.
  • upcoming {true or false} Only show productions that have upcoming events. Default false.
  • limit {number} The maximum number of productions to show. No maximum when left empty.
  • season {number} The ID of a season. Only show productions of a particular season. Default <empty>.
  • category {string} An array of category names (slugs). Only show productions within certain categories. Default <emtpy>.

Template

The event listing uses a template to generate the HTML for each event. The default template is:

{{thumbnail|permalink}} {{title|permalink}} {{dates}} {{cities}}

It is possible to use your own template by using an enclosing shortcode:

[wpt_productions]<h3>{{title}}</h3><p>{{datese}}}<br />{{cities}}</p>[/wpt_productions]

Available fields:

  • {{categories}}
  • {{cities}}
  • {{content}}
  • {{dates}}
  • {{excerpt}}
  • {{thumbnail}}
  • {{title}}
  • {{summary}}

To turn a field into a link, you can add a permalink filter to the placeholder:

{{title|permalink}}

By default, all dates are formatted using the date format setting in WordPress. To use another format, you can add a date filter to the placeholder:

{{datetime|date('D j')}}

Custom fields

If you added a custom field to the productions then you can also use this a a placeholder. To display a custom 'composer' field:

{{composer}}

More examples

Show all upcoming productions:

[wpt_productions upcoming="1"]

Show all productions, grouped by season:

[wpt_productions upcoming groupby="season"]

Show all productions, paginated by season:

[wpt_productions paginateby="season"]

Show all productions, paginated by season and grouped by category:

[wpt_productions paginateby="season" groupby="category"]

Show all upcoming events with the production title and summary:

[wpt_productions fields="title,summary"]

Show the first 10 upcoming productions:

[wpt_productions limit="10"]

Show productions in the drama and music categories:

[wpt_productions category="drama,music"]

Event calendar

A calendar with all upcoming events:

[wpt_calendar]
Clone this wiki locally