<?php

global $wpdb, $post;
// Get data
$item_data = get_hewebal_schedule_data($post->ID);
// We don't need a page for "other"
if (in_array($item_data->event_type, array('Auditorium', 'Food', 'Other'))) {
    wp_redirect('https://hewebal.com/schedule/');
    exit;
}
get_header();
// What time is it?
$current_time = new DateTime('now', new DateTimeZone('America/Chicago'));
// Get start time
$start_time = new DateTime("{$item_data->event_date} {$item_data->event_start_hour}:{$item_data->event_start_minute}", new DateTimeZone('America/Chicago'));
// Get end time
$end_time = !empty($item_data->event_date) && !empty($item_data->event_end_hour) ? new DateTime("{$item_data->event_date} {$item_data->event_end_hour}:{$item_data->event_end_minute}", new DateTimeZone('America/Chicago')) : false;
?>
<div class="single-schedule <?php 
echo $item_data->event_type;
?>
"><?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
<div class="panel panel-default schedule-item-details">
                <div class="panel-heading">
                    <h3 class="panel-title">Session Details</h3>
                </div>
                <div class="panel-body">
示例#2
0
<?php

// Template Name: HEWEBAL Schedule
get_header();
// Get the schedule data
if ($schedule_data = get_hewebal_schedule_data()) {
    // What time is it?
    $current_time = new DateTime('now', new DateTimeZone('America/Chicago'));
    ?>
<div class="schedule-main-buttons-wrapper">
        <?php 
    /*<a class="conference-eval btn btn-primary btn-block" href="https://www.surveymonkey.com/r/26WHCFR">Submit conference feedback</a>*/
    ?>
        <a href="#" class="btn btn-primary go-to-current-event">Go To Current Event</a>
    </div><?php 
    foreach ($schedule_data as $day_key => $day) {
        // Create the date for this day
        $day_date = new DateTime($day_key, new DateTimeZone('America/Chicago'));
        // Has this date passed?
        //$day_has_passed = $day_date->format( 'j' ) < $current_time->format( 'j' );
        // Wrap in collapsible block
        /*if ( $day_has_passed ) {
              echo '<div class="collapsible-schedule-block">';
          }*/
        ?>
<h2 class="schedule-header"><?php 
        echo $day_date->format('l, F j');
        ?>
</h2>
        <div class="schedule-table"><?php 
        // Print the events