Created
October 31, 2013 16:25
-
-
Save huntlyc/7252633 to your computer and use it in GitHub Desktop.
This example shows how to output an unordered list of all events using the Really Simple Events Plugin (http://wordpress.org/plugins/really-simple-events/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function documentation for 'hc_rse_get_events($listType, $showEvents = -1, $startdate = -1, $enddate = -1)' | |
* Depending on the list type, get the events | |
* | |
* @param str $listType - [all|all-reverse|upcoming|upcoming-reverse|past|past-reverse] | |
* @param int $showEvents (optional) - the number of events to show | |
* @param date $startdate (optional) - date range to start | |
* @param date $enddate (optional) - date range to finish | |
* @return $wpdb result set $events - Result set of the query | |
*/ | |
$events = hc_rse_get_events('all'); | |
?> | |
<?php if($events): ?> | |
<ul> | |
<?php foreach($events as $event): ?> | |
<?php if($event->link != ''): //show linked event ?> | |
<li> | |
<a href="<?php echo hc_rse_display_link($event->link); ?>" title="Details for <?php echo stripslashes($event->title); ?>"> | |
<php echo date('d/m/Y H:i', strtotime($event->start_date)); ?> - <?php echo stripslashes($event->title); ?> | |
</a> | |
</li> | |
<?php else: //show normal event ?> | |
<li><php echo date('d/m/Y H:i', strtotime($event->start_date)); ?> - <?php echo stripslashes($event->title); ?></li> | |
<?php endif; ?> | |
<?php endforeach; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment