コード例 #1
0
/**
 * UCFBands Shortcode: Schedule
 *
 * @author Jordan Pakrosnis
 */
function ucfbands_shortcode_schedule($atts, $content = null)
{
    //-- ATTRIBUTES --//
    $a = shortcode_atts(array('id' => ''), $atts);
    // Post ID
    $schedule_id = esc_attr($a['id']);
    // Get Post
    $schedule = get_post($schedule_id);
    // Shortcode Output String
    $output = '';
    //==========//
    //  OUTPUT  //
    //==========//
    // Container
    $output .= '<div class="schedule-shortcode">';
    // Not Found?
    if ($schedule == null) {
        $output .= '<p>Schedule Not Found</p>';
    } else {
        $output .= ucfbands_output_schedule($schedule_id);
    }
    // Close Container
    $output .= '</div>';
    // Return Output String
    return $output;
}
コード例 #2
0
/**
 * UCFBands Event Single - Content with Location, Schedule, and Program Data
 *
 * @author Jordan Pakrosnis
 */
function ucfbands_event_single_content()
{
    $event_meta = $GLOBALS["event_meta"];
    // CONDITIONAL LAYOUT SETUP //
    // Defaults
    $show_content = false;
    $show_schedule = true;
    $show_program = true;
    $show_hr = false;
    $show_schedule_program_wrap = false;
    // Content
    if (get_the_content() != '') {
        $show_content = true;
        $show_hr = true;
        $show_schedule_program_wrap = true;
        $width_content = 'two-thirds first';
        $width_location = 'one-third';
        $width_schedule = 'one-half first';
        $width_program = 'one-half';
    } else {
        $width_location = 'one-third first';
        $width_schedule = 'one-third';
        $width_program = 'one-third';
    }
    // Schedule
    if ($event_meta['attached_schedule'] == null) {
        $show_schedule = false;
    }
    // Program
    if ($event_meta['program_group'] == null) {
        $show_program = false;
    }
    //-- POST CONTENT --//
    if ($show_content) {
        echo '<div class="' . $width_content . '">';
        the_content();
        echo '</div>';
    }
    //-- LOCATION --//
    // Column Wrapper & Title
    echo '<div class="' . $width_location . '"><h2><i class="fa fa-map-marker"></i>&nbsp;&nbsp;Location</h2>';
    // Google Map
    echo ucfbands_location_get_google_map($event_meta['location']);
    // Address
    echo ucfbands_location_get_address($event_meta['location']);
    echo '</div>';
    // Wrap
    if ($show_schedule_program_wrap) {
        echo '<div class="event-schedule-repitoire clearfix">';
    }
    // HR
    if ($show_hr) {
        echo '<hr>';
    }
    //-- SCHEDULE --//
    if ($show_schedule) {
        echo '<div class="' . $width_schedule . '">';
        // Get Schedule Items
        $schedule = $event_meta['attached_schedule'];
        // Get Schedule
        echo ucfbands_output_schedule($schedule, true);
        echo '</div>';
    }
    // show schedule
    //-- PROGRAM --//
    if ($show_program) {
        if ($show_schedule) {
            echo '<div class="' . $width_program . '">';
        } else {
            $width_program .= ' first';
            echo '<div class="' . $width_program . '">';
        }
        // Get Program & Guest Composer
        $program = $event_meta['program_group'];
        $program_guest_composer = $event_meta['program_guest_composer'];
        // Get Program
        echo ucfbands_event_program($program, $program_guest_composer);
        // Close Wrapper
        echo '</div>';
    }
    // show program
    // Wrap Close
    if ($wrap_schedule_program) {
        echo '</div>';
    }
}