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