71 lines
2.9 KiB
PHP
71 lines
2.9 KiB
PHP
<?php
|
|
|
|
$show_event_layout_style = Upstudy::setting( 'tribe_events_archive_style' );
|
|
$show_event_excerpt = Upstudy::setting( 'show_event_excerpt' );
|
|
$tbe_price = Upstudy::setting( 'tbe_price' );
|
|
$show_event_date = Upstudy::setting( 'show_event_date' );
|
|
$show_event_vanue = Upstudy::setting( 'show_event_vanue' );
|
|
$events_columns = Upstudy::setting( 'events_columns' );
|
|
|
|
$date_format = Upstudy::setting( 'upstudy_events_date_format' );
|
|
$time_format = Upstudy::setting( 'upstudy_events_time_format' );
|
|
$date_separator = Upstudy::setting( 'upstudy_events_date_separator' );
|
|
$time_separator = Upstudy::setting( 'upstudy_events_time_separator' );
|
|
|
|
$event_id = get_the_ID();
|
|
$start_date = tribe_get_start_time ( $event_id, $date_format);
|
|
$end_date = tribe_get_end_time ( $event_id, $date_format);
|
|
|
|
$start_time = tribe_get_start_date( null, false, $time_format );
|
|
$end_time = tribe_get_end_date( null, false, $time_format );
|
|
|
|
$event_vanue = tribe_get_venue();
|
|
|
|
$organizer_ids = tribe_get_organizer_ids();
|
|
$multiple = count($organizer_ids) > 1;
|
|
|
|
// get event start day and month individually
|
|
$start_day = tribe_get_start_date( $event_id, false, 'd' );
|
|
$start_month = tribe_get_start_date( $event_id, false, 'M' );
|
|
|
|
$event = get_post( $event_id );
|
|
|
|
$upstudy_tribe_event_thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'upstudy-post-thumb' );
|
|
if ( isset( $upstudy_tribe_event_thumb_src ) && ! empty( $upstudy_tribe_event_thumb_src ) ) :
|
|
$upstudy_tribe_event_thumb_url = $upstudy_tribe_event_thumb_src[0];
|
|
else :
|
|
$upstudy_tribe_event_thumb_url = '';
|
|
endif;
|
|
|
|
echo '<div class="tpc-event-item tpc-event-style-'.esc_attr($show_event_layout_style).'">';
|
|
echo '<div class="inner">';
|
|
if ( has_post_thumbnail() && get_the_post_thumbnail_url() ) :
|
|
echo '<div class="thumbnail">';
|
|
echo '<a href="' . esc_url( get_the_permalink() ) . '">';
|
|
echo '<img src="' . esc_url( $upstudy_tribe_event_thumb_url ). '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '" >';
|
|
echo '</a>';
|
|
|
|
echo '</div>';
|
|
endif;
|
|
|
|
echo '<div class="content">';
|
|
|
|
if ( $show_event_date || $show_event_vanue ) {
|
|
|
|
echo '<div class="upstudy-event-meta">';
|
|
if ( $show_event_date ) {
|
|
echo '<span class="event-date"><i class="dt-icon-calendar"></i>'. esc_html( $start_date ).'</span>';
|
|
}
|
|
|
|
if ( $show_event_vanue){
|
|
echo '<span class="event-location"><i class="dt-icon-maps-and-flags"></i>'. esc_html( $event_vanue ).'</span>';
|
|
}
|
|
echo '</div>';
|
|
}
|
|
|
|
the_title( '<h5 class="event-title"><a href="' . esc_url( get_the_permalink() ) . '" class="post-link">', '</a></h5>' );
|
|
|
|
echo '</div>';
|
|
echo '</div>';
|
|
|
|
echo '</div>'; |