• Resolved webrightnow

    (@webrightnow)


    After a recent update of WP and plugins, the Events Lists widgets have started displaying the wrong dates. On the homepage, the widget that is set to show a single event (limited to featured events ticked) shows the current date and time instead of the event’s time.
    On the calendar pages (/events/month), where I am using a custom sidebar with a different Events Lists widget, the widget is set to display two events (not limited to featured). The events are showing, but both with the wrong date and time: June 21 @ 7pm. Neither event is happening on that date, although an event on 21 June 2018 did happen. Interestingly, if I trash that past event, the date on both events changes to another random one: October 6th. There doesn’t appear to be anything special about either event.
    I tested for conflicts. If I switch to Twenty Sixteen, the dates are correct.
    Disabling all other plugins doesn’t fix it, so it has to be a theme conflict, but one that has only been introduced since the recent WP / plugin update, the theme itself hasn’t been changed (it’s a customized version of Sparkling).
    No JS errors showing in browser console.
    I don’t even know where to start diagnosing the conflict, can anyone help?
    Thanks.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter webrightnow

    (@webrightnow)

    Ok got it. I had completely forgotten that I had added the following code to the theme’s functions.php:

    function custom_widget_featured_image() {
    	global $post;
    
    	echo tribe_event_featured_image( $post->ID, 'full' );
    }
    add_action( 'tribe_events_list_widget_before_the_event_title', 'custom_widget_featured_image' );
    
    function custom_widget_excerpt() {
    	global $post;
    
    	echo tribe_events_get_the_excerpt($post);
    }
    add_action( 'tribe_events_list_widget_after_the_event_title', 'custom_widget_excerpt' );

    This was because I needed to add a featured image and excerpt to the Event List widget. I didn’t write the code btw, I borrowed it from somewhere else (can’t remember where).

    It was working until recently, now it’s clearly causing a conflict. If I remove it, the dates are showing correctly.

    How can I modify the code to work with the latest plugin version? I still really need those widgets to show the excerpt and featured image.

    Thread Starter webrightnow

    (@webrightnow)

    Solved it by removing just the excerpt portion of the custom code in functions.php and then following the instructions at https://theeventscalendar.com/knowledgebase/add-event-content-to-an-event-widget/ to add the excerpt to the widget. All working now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrong dates in Events List widgets, possible theme conflict.’ is closed to new replies.