WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using this plugin: http://wordpress.org/extend/plugins/event-organiser/

I notice a field in the widget called "Template (leave blank for default)". How would I use this field to show the standard list of events, but with only the date (not the time), and only display the year if it's not this year?

share|improve this question
up vote 0 down vote accepted

The template field allows you to enter what will appear on the event list widget. It accepts various place holders (you can see the documentation here - the template can be used for the [eo_events] shortcode too).

One of the place-holders is %start{date-format}{time-format}% which outputs the start date/time of an event with the specified date and time format. If it is an all day event, the time format is ignored.

To output just the date part you can use it in the form $start{date-format}% for example

//Output date in the form 1st September 2012
$start{jS M Y}%

Currently, however, there conditional statements are not supported. But I may be adding the option to use a template file instead. This would use a template from your theme folder (if it exists) or else a default template file from the plug-in. This template file will simply contain a while loop (the same as you find in many themes) and would be responsible for outputting the event list.

This would give you a great degree of freedom since you can perform conditional statements such as

if( eo_get_the_start('Y') == date_i18n('Y') ){
    //Event starts this year - don't include year in date format
    echo eo_get_the_start('jS M');

    //Event starts in a different year - include year in date format
    echo eo_get_the_start('jS M Y');

share|improve this answer
Awesome!! Thank you so much. Here's what I ended up putting in the widget field: <a href="%event_url%">%event_title%</a> on %start{F j, Y}% – Zade Sep 2 '12 at 2:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.