1. Home
  2. WP Event Aggregator
  3. Shortcodes

Shortcodes

Basic Shortcode :

[wp_events]

You can add the shortcode [wp_events] to any post or page on your site.

 

Display New Layout :

[wp_events layout="style2"]

You can display the new layout by adding the [wp_events layout=”style2″] shortcode to any post or page on your site.

 

Display layout:

[wp_events col="2"]

The layout also comes complete with an advanced set of filtering options and these can also be used with the shortcode. The above example looks for events in column 2. If you don’t put this option in shortcode by default it will display in column 3 layout and the maximum column is 4.

 

Limit for display events

[wp_events posts_per_page="12"]

posts_per_page  used for number of events you want to show on one page. Above is example posts_per_page=″12″ it will display maximum 12 events.This option is optional.By default it will display 10 events on one page.

 

Display events based on category

[wp_events category="cat1"]

If you want to display events based on a category then put category = ″cat1″ in the shortcode. Use commas when you want multiple categories like category= ″cat1,cat2″ in your shortcode.

(Note: If category and its slug different then put category slug).

 

Display Past events

Show outdated (past) events ( events that have already happened).

[wp_events past_events="yes"]

If you want to display only past events then put past_events=″yes″ in your short-code. If you want to display all events mean past and upcoming then use past_events=″yes″ with start and ending date. Here is an example that displays all events (past events +upcoming events).

[wp_events past_events="yes" start_date="YYYY-MM-DD" end_date="YYYY-MM-DD"]

 

Display Events based on order

[wp_events order="asc"]

order – Order of the events to be shown. Value can be asc or desc. Order is based on event date and post title.

 

Display Events based on orderby

[wp_events order="asc" orderby="post_title"]

orderby – Order by event date and post title.Here is example to sort events by event  date  [wp_events orderby=″event_start_date].

 

Short-Code:

[wp_events col="2" posts_per_page="12" category="cat1,cat2" past_events="yes" order="asc" orderby="post_title" start_date="YYYY-MM-DD" end_date="YYYY-MM-DD"]

Note : Make sure starting and ending quote(")are same in short-code attribute.

Was this article helpful to you? Yes 1 No

How can we help?