Event Search

The event search shortcode is included in Event Organiser Pro. If you haven’t done so already, you can purchase Pro here: wp-event-organiser.com/pricing.

The event search shortcode [event_search] adds a search form to your page which allows your visitors to search, and optionally filter, your events.

The attributes

Filters

The filters attribute accepts comma separated list of the filters you want to be available to your visitors. The order in which you specify the filters is the order in which they appear.

Possible filters include

  • event_category – a drop-down to filter events by category
  • event_venue – a drop-down to filter events by venue
  • event_tag – a drop-down to filter events by tag
  • city – a drop-down to filter events by city
  • state – a drop-down to filter events by state
  • country – a drop-down to filter events by country
  • date – two fields with datepickers to filter events by a date range.

Other attributes

You can restrict the search to certain venues, categories etc or set the number of events returned per page by using any of the attributes supported by the event list shortcode.

Any event query attributes specified will form part of the event query, but any of the above filters will over-ride those attributes. For example:

 [event_search event_start_after="now" filters="date"]

will, by default show only events which start in the future. However, the user could use the date filter to search for past events too.

Note: You should use posts_per_page to configure the number of returned events on each page, and not numberposts**

For example, this will configure the search to return 5 events per page (default is 10):

 [event_search posts_per_page="5"]

Examples

The shortcode produces something like:

event-search-2

To create the above search form:

 [event_search filters="event_category,event_venue,date"]

If you wanted to the date filter to appear immediately to the right of the search field

 [event_search filters="date,event_category,event_venue"]

Formatting the output

You can change how the search results appear on the page by copying the template file search-event-list.php from inside the templates subdirectory of Event Organiser Pro and editing there as desired. See editing the templates for more information.