<?php
/* Template Name: Events
*/

?>

<?php
get_header();
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    $args = array(
      'post_type' => 'lif_event',
      'post_status' => 'publish',
      'paged' => $paged

    );
   $opt         = lifeline()->options();
$title_limit = lifeline_get( $opt, 'event_list_title_character_limit', '15' ); 

$ch_limit = lifeline_get( $opt, 'event_list_character_limit', '15' );

$style = lifeline_get( $opt, 'event_listing_style' ); 


    $query = new WP_Query($args);
if ($query->have_posts()) :


?>
<section class="py-110">
	<?php if ($style == 'event-list') {
		echo '<div class="custom-continer-fluid">';
		echo '<div class="event-style4">';
	} else {
		echo '<div class="container">';
		echo '<div class="row">';
	} ?>
		<?php while ( $query->have_posts() ) : $query->the_post();  ?>
			
			 <?php lifeline_template_load( 'templates/event/'.$style.'.php', compact( 'title_limit', 'ch_limit') ); ?>
		<?php endwhile; wp_reset_postdata(); ?>
		
		<?php endif; ?>
		</div>
		<?php lifeline_the_pagination($query->max_num_pages); ?>
	</div>
</section>

<?php
get_footer();
