File: /storage/v6964/iskcon/public_html/wp-content/themes/tow-temple/single-event.php
<?php
/**
* The template for displaying event single page
*
* @package tow
*/
get_header();
wp_enqueue_style( 'tow-style-event', get_template_directory_uri() . '/assets/css/events.css' );
$event_country = get_post_meta( get_the_ID(), 'event_country', true );
$event_address = get_post_meta( get_the_ID(), 'event_address', true );
$event_datetime = get_post_meta( get_the_ID(), 'event_datetime', true );
// Check if the timestamp exists and then format it
if ( ! empty( $event_datetime ) ) {
// Format the timestamp to a readable date, e.g., 'F j, Y g:i a' for 'January 1, 2024 1:00 pm'
$event_date = ucfirst(date( 'j M, Y', $event_datetime ));
$event_time = date( 'g:i a', $event_datetime );
}
?>
<section id="event_dt" class="mt-4 pb-0 w-75 mx-auto">
<div class="container-xl">
<div class="event_dt1 row">
<div class="col-md-8" id="post-<?php the_ID(); ?>">
<div class="event_dt1l">
<div class="event_dt1l1 row">
<div class="col-md-6 col-sm-6">
<div class="event_dt1l1l bg_oran rounded_20 px-4 pb-4">
<h5 class="fs-6 text-white"><span class="d-inline-block bg_blue text-white text-center fs-5 me-2"><i class="fa fa-clock"></i></span> Date & Time</h5>
<h6 class="font_14 text-white mt-3"><?php print $event_time;?></h6>
<h6 class="mb-0 font_14 text-white"><?php print $event_date;?></h6>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="event_dt1l1l bg_blue rounded_20 px-4 pb-4">
<h5 class="fs-6 text-white"><span class="d-inline-block bg_oran text-white text-center fs-5 me-2"><i class="fa fa-map-marker"></i></span> Location</h5>
<h6 class="font_14 text-white mt-3"><?php print $event_address;?></h6>
</div>
</div>
</div>
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', 'event' );
endwhile; // End of the loop.
?>
</div>
</div>
<div class="col-md-4">
<?php dynamic_sidebar( 'event-sidebar' ); ?>
</div>
</div>
</div>
</section>
<?php
get_footer();