Event map shortcode not showing future event

WordPress Event Management, Calendars & Registration Forums General Question Event map shortcode not showing future event

This topic contains 4 replies, has 2 voices, and was last updated by  Andy Burns 3 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40286

    I have an event map shortcode as the following:

    [event_map width=”100%” height=”1000px” showpastevents=”false” numberposts=”50″ event_start_before=”+365″]

    However it is not showing an event in February 18 – 20, 2022. Why? Is there hardcoded logic that limits future events?

    As you see I even tried to add the parameter event_start_before=”+365″ to force it to show all future events within a year.

    Thanks for your help,

    Andy Burns
    #40355

    Hi Andy,

    I’ve tried this, and it should show future events. I assume you have fewer than 50 event dates before February 18th.

    There are defaults, but no hard-coded logic. But note that the shortcode will retrieve the next 50 event dates, that start before a year’s time. It will then only show those events which have a venue with a location associated. So the map might not show 50 events.

    Stephen Harris
    #40360

    Very odd. I can confirm this event is within a year and has a venue and map is only showing 6 events currently.

    I don’t know how to debug further.

    Andy Burns
    #40419

    Hi Andy,

    On line 446 of event-organiser-pro/includes/shortcodes.php you can add the line:

        error_log("\nvenue map: $event->ID / $event->occurrence_id at $venue_id", 3,  WP_CONTENT_DIR . '/debug.log');
    

    so it should read:

    foreach( $events as $event ){
        $venue_id = (int) eo_get_venue( $event->ID );
        error_log("\nvenue map: $event->ID / $event->occurrence_id at $venue_id", 3,  WP_CONTENT_DIR . '/debug.log');
    
        if( $venue_id ){
    

    Then in your wp-config.php you can add the lines

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    

    and then view the event map shortcode. You should find a file debug.log in your WP_CONTENT directory with the event ID and occurrence ID of the events that matched the query, along with their venue ID.

    Do the logs show more than 6 events? Is the event you’re interested in, in those logs? Does the list contain 50 events? If so, and your event is not in them, try increasing that number.

    Stephen Harris
    #40478

    Thanks for the debug help, Stephen. Unfortunately, the site is not writing to the debug.log 🙁 Not sure why but then I tried fiddling with the numberposts parameter and set to numberposts=”100″. Now more is showing up. Not sure why it is always 6 events for me.

    I looked at event posts and seeing 8 events and then some recurring ones without venues. Anwyway, the numberposts=”100″ hack seems to work…

    Andy Burns
Viewing 5 posts - 1 through 5 (of 5 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.