66 lines
3.0 KiB
PHP
66 lines
3.0 KiB
PHP
<?php
|
|
/**
|
|
* The Template for displaying content events.
|
|
*
|
|
* Override this template by copying it to yourtheme/wp-events-manager/content-event.php
|
|
*
|
|
* @author ThimPress, leehld
|
|
* @package WP-Events-Manager/Template
|
|
* @version 2.1.7
|
|
*/
|
|
|
|
/**
|
|
* Prevent loading this file directly
|
|
*/
|
|
defined( 'ABSPATH' ) || exit();
|
|
$upstudy_archive_events_style = Upstudy::setting( 'tp_events_archive_style' );
|
|
$upstudy_archive_tp_event_date = Upstudy::setting( 'upstudy_archive_tp_event_date' );
|
|
$upstudy_archive_tp_event_price = Upstudy::setting( 'upstudy_archive_tp_event_price' );
|
|
$upstudy_archive_tp_event_excerpt = Upstudy::setting( 'upstudy_archive_tp_event_excerpt' );
|
|
|
|
$event = new WPEMS_Event( get_the_ID() );
|
|
|
|
$upstudy_tp_event_thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'upstudy-post-thumb' );
|
|
if ( isset( $upstudy_tp_event_thumb_src ) && ! empty( $upstudy_tp_event_thumb_src ) ) :
|
|
$upstudy_tp_event_thumb_url = $upstudy_tp_event_thumb_src[0];
|
|
else :
|
|
$upstudy_tp_event_thumb_url = '';
|
|
endif;
|
|
|
|
$tpc_tp_event_start_time = get_post_meta( get_the_ID(), 'tp_event_date_start', true ) ? strtotime( get_post_meta( get_the_ID(), 'tp_event_date_start', true ) ) : '';
|
|
$tpc_tp_event_location = get_post_meta( get_the_ID(), 'tp_event_location', true ) ? get_post_meta( get_the_ID(), 'tp_event_location', true ) : '';
|
|
$tpc_tp_event_time_start = wpems_event_start( get_option( 'time_format' ) );
|
|
$tpc_tp_event_time_end = wpems_event_end( get_option( 'time_format' ) );
|
|
$tpc_tp_event_starting_date = wp_date( 'F j, Y', $tpc_tp_event_start_time );
|
|
$tpc_tp_event_start_date = explode( '/', $tpc_tp_event_starting_date );
|
|
|
|
// get event start day and month individuall
|
|
$start_day = wp_date( 'd', $tpc_tp_event_start_time );
|
|
$start_month = wp_date( 'M', $tpc_tp_event_start_time );
|
|
|
|
|
|
echo '<div class="tpc-event-item tpc-event-style-'.esc_attr($upstudy_archive_events_style).'">';
|
|
|
|
echo '<div class="inner">';
|
|
if ( $upstudy_archive_tp_event_date ) {
|
|
echo '<div class="upstudy-event-date">';
|
|
echo '<span class="day">'.$start_day.'</span>';
|
|
echo '<span class="month">'.$start_month.'</span>';
|
|
echo '</div>';
|
|
|
|
}
|
|
echo '<div class="content">';
|
|
|
|
the_title( '<h5 class="event-title"><a href="' . esc_url( get_the_permalink() ) . '" class="post-link">', '</a></h5>' );
|
|
echo '<div class="upstudy-event-meta">';
|
|
echo '<span class="event-time"><i class="dt-icon-clock"></i>'. esc_html( $tpc_tp_event_time_start ).' - '.esc_html( $tpc_tp_event_time_end ).'</span>';
|
|
echo '</div>';
|
|
if ( $tpc_tp_event_location ) :
|
|
echo '<div class="upstudy-event-meta">';
|
|
echo '<span class="event-location"><i class="dt-icon-maps-and-flags"></i>'. esc_html( $tpc_tp_event_location ).'</span>';
|
|
echo '</div>';
|
|
endif;
|
|
|
|
echo '</div>';
|
|
echo '</div>';
|
|
echo '</div>'; |