You problem likely results from the tribe_events_get_the_excerpt()
function calling wp_reset_postdata()
, which resets the global $post
object back to the original query (i.e., the page the footer is on). get_the_ID()
returns the ID of the global $post
object, so you will get the page’s ID instead of the event’s from within the loop. And setup_postdata()
does not assign the global $post
variable.
Simpliest solution in this case should be to replace get_the_ID()
with $post->ID
($post
referring to the loop’s local event value here, not the global):
<?php echo tribe_get_event_meta( $post->ID, '_EventURL', true ); ?>