WordPress.org

Ready to get started?Download WordPress

Forums

Event Organiser
[resolved] Show events by venue (2 posts)

  1. joelfreeborn
    Member
    Posted 2 years ago #

    Hi there...me again!

    Great to see the new update. This keeps getting better...thank you!

    Just stuck on trying to show events by venue using the code below (I'm thinking venues aren't done by 'taxonomy'?). Venue slug is 'st-johns-peasedown'.

    ****************

    <?php
    $events = eo_get_events(array(
    'numberposts'=>3,
    'tax_query'=>array(
    array(
    'taxonomy'=>'venue',
    'operator' => 'IN',
    'field'=>'slug',
    'terms'=>array('st-johns-peasedown')
    )
    )
    ));
    ?>
    <?php
    if($events):
    $return= '<ul class="eo-events eo-events-shortcode">';
    foreach ($events as $event):
    //Check if all day, set format accordingly
    if($event->event_allday){
    $format = get_option('date_format');
    }else{
    $format = get_option('date_format').' '.get_option('time_format');
    }
    $return .= '

  2. post_title.'" href="'.get_permalink($event->ID).'">'.$event->post_title.' on '.eo_format_date($event->StartDate.' '.$event->StartTime, $format).'

  3. ';
    endforeach;
    $return.='';
    echo $return;
    endif;
    ?>

    ******************

    Thanks :)

    http://wordpress.org/extend/plugins/event-organiser/

  • Stephen Harris
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, events are not currently custom taxonomies. 1.3, when it is released, will change that (but the front-end will still look the same). For now you can restrict posts to a certain venue by simply using the 'venue' argument (which takes the venue slug). See the documentation on eo_get_posts:

    $events = eo_get_events(array(
    'numberposts'=>3,
    'venue'=>'st-johns-peasedown'
    ));

    As I mentioned 1.3 will change this, by migrating venues to an 'event-venue' taxonomy - this brings it inline with 'event-category' and 'event-tag'. Nothing will need to be changed, but with 1.3 I recommend you use the native tax query, and change the venue template file to taxonomy-event-venue.php.

    Also - could you edit your question? It seems to have upset the forum page...?

  • Topic Closed

    This topic has been closed to new replies.

    About this Plugin

    About this Topic

    Tags