Your approach should work I think, I would check only if short PHP open tags <?
are working in your server configuration because they are deprecated for some time and should be replaced with <?PHP
.
Alternatively have you tried the approach from the plugin’s docs using the build in function tribe_get_events()
:
<ul class="evul" >
<?PHP
// Ensure the global $post variable is in scope
global $post;
$events = tribe_get_events();
// Loop through the events: set up each one as
// the current post then use template tags to
// display the title and content
foreach ( $events as $post ) {
setup_postdata( $post );
// This time, let's throw in an event-specific
// template tag to show the date after the title!
?>
<li class="evlist" id="evli-">
<span class="evdate" id="evspd-">
<?= tribe_get_venue($post) ?>
</span>
<span class="evtype" id="evspt-">
<?= tribe_get_events_link($post) ?>:
</span>
<span class="evdesc" id="evspds-">
<?= get_the_title($post); ?>
</span>
</li>
<?PHP
}
?>
</ul>