Files

93 lines
4.4 KiB
PHP
Raw Permalink Normal View History

2026-04-23 04:33:43 +03:30
<?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_location = Upstudy::setting( 'upstudy_archive_tp_event_location' );
$upstudy_archive_tp_event_price = Upstudy::setting( 'upstudy_archive_tp_event_price' );
$upstudy_archive_tp_event_excerpt = Upstudy::setting( 'upstudy_archive_tp_event_excerpt' );
$upstudy_archive_tp_event_read_more = Upstudy::setting( 'upstudy_archive_tp_event_read_more' );
$upstudy_archive_tp_read_more_text = Upstudy::setting( 'tp_event_archive_read_more_text' );
$tp_event_excerpt_words = Upstudy::setting( 'tp_event_excerpt_words' );
$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 individual
$start_day = wp_date( 'd', $tpc_tp_event_start_time );
$start_month = wp_date( 'F', $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 ( 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_tp_event_thumb_url ). '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '" >';
echo '</a>';
if ( $upstudy_archive_tp_event_date && $start_day) {
echo '<div class="event-date-time-wrap">';
echo '<div class="event-date">';
echo '<span class="day">' . esc_html( $start_day ) . '</span>';
echo '</div>';
echo '<div class="event-month-time">';
echo '<div class="month">' . esc_html( $start_month ) . '</div>';
echo '<div class="event-time-start-end">';
echo esc_html( $tpc_tp_event_time_start);
echo '<span class="event-time-separate">'. esc_attr__( 'to', 'upstudy' ) . '</span>';
echo esc_html( $tpc_tp_event_time_end);
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div>';
endif;
echo '<div class="content">';
if($upstudy_archive_tp_event_location){
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;
}
the_title( '<h5 class="event-title"><a href="' . esc_url( get_the_permalink() ) . '" class="post-link">', '</a></h5>' );
if ( $upstudy_archive_tp_event_excerpt ) :
echo '<div class="excerpt-text">';
echo wpautop( wp_trim_words( wp_kses_post( get_the_excerpt() ), $tp_event_excerpt_words ) );
echo '</div>';
endif;
echo '</div>';
echo '</div>';
echo '</div>';