Viewing 8 replies - 1 through 8 (of 8 total)
  • +1 here. also looking for an answer to this one.

    First of all – sorry to @roci, I seem to have missed this post.

    There are two approaches:

    1. Create a page, and use this shortcode. The shortcode takes many attributes, among which are ‘event_end_before’ and ‘event_start_before’. This take relative date/times – so you can have ‘event_end_before’=’now’:

    [eo_events event_end_before='now']

    Not that it will only consider the date part and is inclusive – i.e. events that end before (or on) today. In 1.5 this will change to consider the time as well.

    2. Custom template with a WP_Query().

    The query can (almost) contain the same arguments as the shortcode can attributes. Certainly the plug-in provided event specific ones. These include ‘event_end_before’ etc.

    E.g.:

    $events = new WP_Query(array(
              'post_type'=>'event',
              'post_per_page'=>-1,
              'event_end_before'=>'now'
          ));
          if( $events->have_posts() ){
              while( $events->have_posts() ): $events->the_post();
              //Content of loop
              endwhile;
          }
          wp_reset_postdata();

    Alternatively you can use eo_get_events (a bit like get_posts()) if you don’t want a loop, but just a list of post objects.

    Please note that these aren’t working examples – I’ve not tested them, and they may contain syntax errors.

    thanks for the reply. i used the short code you supplied and it worked yesterday with no problem. there was only 1 item in the past events and it showed up. however, today, that item disappeared when a second item was moved to the past events. after testing i found that the shortcode works when there’s only one event in the past, but not with multiple events. am i missing something?

    An item being an occurrence of an event?

    Try:

    [eo_events event_end_before='now' showpastevents=true]

    A little perverse – but if ‘showpastevents’ isn’t set, it uses the default set in the plug-in settings (as is what is considered a ‘past’ event – an event that has started/ event that has finished).

    I’m improving the performance of the queries in 1.5, and as part of that, ‘showpastevents’ in the shortcode will be ‘true’ unless otherwise explicitly set – this will remove the need for this rather odd setup.

    Also – be sure you are not grouping occurrences (unless you mean to) – in that case a past event is only past if all its occurrences are.

    you win internets! that worked! thanks for the prompt reply.

    i purchased a WP theme with the plugin integrated and i’m not too familiar with working with shortcodes and some of the coding yet, so thanks for your patience and help.

    Can we change the order here
    [eo_events event_end_before=’now’ showpastevents=true]
    to show the first one on the list the event which is last end.

    Like this
    – event 18. 08. 2010.
    – event 09. 07. 2010.
    – event 01. 06. 2010.

    I try this https://www.harriswebsolutions.co.uk/event-organiser/documentation/shortcodes/event-list-shortcode/ and get list by categories, but I just want different order of this.

    Thank you very much for help

    Hi Antena,
    Yes the shortcode accepts the same arguments as get_posts() does, so the following should work:

    [eo_events event_end_before='now' showpastevents=true order='desc']

    Yes, fantastic. it works ??
    thank you very much.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Event Organiser] Archive page’ is closed to new replies.