eo_venue_link breaking get_footer and get_sidebar

WordPress Event Management, Calendars & Registration Forums Report A Bug eo_venue_link breaking get_footer and get_sidebar

This topic contains 1 reply, has 1 voice, and was last updated by  Jon Packman 10 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12667

    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
    #12668

    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
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.