I couldn’t find or work out if its possible to display just the events for today’s date in the widget area.
Thanks
Nick
Nick
anyone?
I couldn’t find or work out if its possible to display just the events for today’s date in the widget area.
Thanks
Nick
Nick
This is not possible with the standard widget.
If you have the capabilities to make your own widget, then the following code should get events for that period.
<?php
$events = eo_get_events(array(
'events_start_after'=>'yesterday',
'events_start_before'=>'tomorrow',
));
if( $events ){
global $post;
echo '<ul>';
foreach( $events as $post ){
setup_postdata($post);
?>
<li>
<a href='<?php the_permalink() ?>'>
<h5><?php the_title(); ?></h5>
<p><?php echo eo_get_venue_name(); ?> on the <?php echo eo_get_the_start('jS F'); ?></p>
</a>
</li>
<?php
}
echo '</ul>';
wp_reset_postdata();
}else{
echo '<h5>No Events Today</h5>';
}
?>
Dario
Here’s a link to the above code, all nicely set out: http://cl.ly/OENj
Dario
Hi Nick,
There’s no existing option for that, but as Dario has said you can create your own widget to do this.
A minor correction to Dario’s post, the query should be:
$events = eo_get_events(array(
'events_start_after'=>'today',
'events_start_before'=>'today',
));
As the event date attributes are inclusive. Of course that retrieves events that start that day, if you have an event spanning a few days you may want to show events running that day:
$events = eo_get_events(array(
'events_end_after'=>'today',
'events_start_before'=>'today',
));
Stephen Harris