Venue Embed

Sometimes it is convenient to embed a list of one or more venues within a page or post, and the [venue_embed] shortcode can be used for this purpose.

Used by itself with no parameters it will generate a list of all venues that have upcoming events. Venues where nothing is taking place in the forseeable future will not be listed by default – though this can easily be changed.

Here’s a list of parameters accepted by [venue_embed]:

  • venue (or venues)
  • city (or cities)
  • state (or states)
  • province (or provinces)
  • postcode (or postcodes)
  • zip (or zips)
  • country (or countries)
  • with_events
  • template

Specifying specific venues

Just like the [event_embed] shortcode, it is possible to specify venue slugs and IDs to include and exclude.

This is an example of including three specific venues, two indicated by their slugs and one by its ID:

[venue_embed venues="the-red-lion, the-black-swan, 512"]

Here is an example that will list all venues (with upcoming events) but exclude two specific venues:

[venue_embed venues="-some-conference-centre, -1024"]

Note the use of – (minus sign) operators. Finally, we can circumvent the restriction on only including venues with upcoming events as follows:

[venue_embed with_events="no"]

Geographic parameters

As you can see from the parameter list above, it is possible to restrict the venue list to venues in a specific area. Example:

[venue_embed city="Glasgow"]

A particular flexible part of this is the postcode/zip support:

[venue_embed zip="902"]

This would match venues taking place at a location where the zip code include “902”, such as “90210”, “90211”, etc. Naturally multiple postcodes/zips can be provided and combined with other parameters:

[venue_embed postcodes="AB1, AB2" city="Aberdeen" with_events="no"]

Inline placeholders

A set of inline placeholders exist so you can easily embed hand-crafted venue information without building full-blown custom PHP templates. Here are the placeholders:

  • link (or url)
  • title (or name)
  • content (or description)
  • excerpt
  • thumbnail

Here is an example – note the curly brace syntax:

[venue_embed city="New York"]
    <a href="{link}"> {name} </a>
    {thumbnail}
[/venue_embed]
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s