<?php get_header();?>
<?php
$url_image_default = get_template_directory_uri() . '/assets/img/events-bc.jpg';
$url_image = (!empty(get_theme_mod( 'header_event_background_image'))) ? get_theme_mod( 'header_event_background_image') : $url_image_default;
$text_read_more = (!empty(get_theme_mod( 'text_read_more_event' ))) ? get_theme_mod( 'text_read_more_event') : '' ;
$header_event_title = ( !empty(get_theme_mod( 'header_event_title' ))) ? get_theme_mod( 'header_event_title' ) : '';
$header_event_desc = ( !empty( get_theme_mod( 'header_event_desc' ))) ? get_theme_mod( 'header_event_desc' ) : '';
?>
<div class="page-content">
<!-- Breadcrumb Section -->
<section class="breadcrumb-events breadcrumb-section section-box" style="background-image: url(<?php echo esc_url($url_image); ?>)">
<div class="container">
<div class="breadcrumb-inner">
<?php if ( $header_event_title != '') : ?>
<h1><?php echo esc_html( $header_event_title );?></h1>
<?php endif; ?>
<?php if( $header_event_desc != '') : ?>
<span class="breadcrumbs-text"><?php echo esc_html( $header_event_desc );?></span>
<?php endif; ?>
</div>
</div>
</section>
<!-- End Breadcrumb Section -->
<!-- Events Section -->
<section class="events-section section-box">
<div class="container">
<div class="row">
<?php if( have_posts() ) : while( have_posts() ) : the_post();
$event_date = get_post_meta(get_the_ID(), 'ova_met_textdate_event', true) ? get_post_meta(get_the_ID(), 'ova_met_textdate_event', true):'';
$img_src = wp_get_attachment_image_url( get_post_thumbnail_id(), 'medium' );
$img_srcset = wp_get_attachment_image_srcset( get_post_thumbnail_id(), 'medium' );
?>
<div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12">
<div class="events-content">
<div class="image">
<a href="<?php the_permalink();?>"><img src="<?php echo esc_url( $img_src ); ?>" srcset="<?php echo esc_url($img_srcset); ?>" sizes="(max-width: 600px) 100vw, 600px" alt="<?php the_title_attribute(); ?>"></a>
</div>
<div class="events-detail">
<?php if( get_theme_mod( 'show_date_event', true ) == 'yes') : ?>
<div class="time">
<i class="zmdi zmdi-calendar-alt"></i>
<span><?php echo date_i18n( get_option( 'date_format' ), strtotime( $event_date ) );?></span>
</div>
<?php endif; ?>
<?php if( get_theme_mod( 'show_title_event', true ) == 'yes' ) : ?>
<h4><a href="<?php the_permalink();?>" title="<?php the_title_attribute();?>"><?php the_title();?></a></h4>
<?php endif;?>
<?php if( get_theme_mod( 'show_excerpt_event', true ) == 'yes' ) : ?>
<p><?php echo wp_trim_words( get_the_excerpt(), 10, '' ); ?></p>
<?php endif; ?>
<?php if( get_theme_mod( 'show_readmore_event', true ) == 'yes' ) : ?>
<a href="<?php the_permalink();?>" title="<?php the_title_attribute();?>" class="more-link"><?php echo esc_html($text_read_more); ?></a>
<?php endif; ?>
</div>
</div>
</div>
<?php endwhile; endif; wp_reset_postdata(); ?>
<?php reon_pagination_theme(); ?>
</div>
</div>
</section>
<!-- End Events Section -->
</div>
<?php get_footer();?>