I’ve come across a strange bug since updating. Using eo_venue_link in my queries outputs the link ok but stops get_sidebar and get_footer from working.
Using eo_venue_link in event-meta-event-single.php works fine. It just seems to break things when used with eo_get_events.
I’ve removed it for now but here’s the code that was causing it:
$event_args = array(
'numberposts' => -1,
'orderby' => 'eventstart',
'order' => 'ASC',
'showpastevents' => false,
'post_status' => 'publish',
'event-category' => 'workshops'
);
$events = eo_get_events($event_args);
if( $events ){
global $post;
echo '<h4 class="widget-title section-title">Upcoming Workshops</h4><ul class="widget">';
foreach( $events as $post ){
setup_postdata($post);
$address_details = eo_get_venue_address();
?>
<?php echo eo_get_the_start('j/m/y'); ?>
'><?php the_title(); ?>, at
">
<?php echo eo_get_venue_name(); ?>
in <?php echo $address_details['city'] ; ?>
<?php }
echo '';
wp_reset_postdata();
}
Thanks for your help.
Jon Packman
So five minutes later and I’ve fixed it. Checking to see if the venue exists first (like in event-meta-event-single.php) solves the problem:
if( eo_get_venue() ){ ?>
Venue: <a href="<?php echo eo_venue_link(); ?>"><?php echo eo_get_venue_name(); ?></a>
<?php } ?>
-
This reply was modified 10 years, 2 months ago by Stephen Harris.
Jon Packman