<?php
/**
 * Template for front page slider
 * @since 1.0
 * @package evaWp
 */
$pst = evawp_get_posts_by_type( evawp_customizer_get( 'slider_type', 'post' ), evawp_customizer_get( 'slider_category', 0 ), 6 );
if( empty($pst) ){
	return;
}?>
 <div class="evawp-front-page-slider-wrapper">
 	<div class="evawp-slider-init">
 		<?php foreach( $pst as $p ):
 			if( has_post_thumbnail( $p ) ){
 				$img = get_the_post_thumbnail_url( $p, 'full' );
 			}else{
 				$img = get_template_directory_uri() . '/assets/img/default-slider.jpg';
 			}?>
			 <div>
 			<div class="evawp-slider-inner" style="background-image: url( <?php echo esc_url( $img ) ?>)">
 				<div class="evawp-slider-content">
 					<h2>
 						<a href="<?php echo esc_url( get_the_permalink( $p ) ); ?>">								
 							<?php echo esc_html( get_the_title( $p ) ); ?>
 						</a>
 					</h2>
 					<?php evawp_content_meta( $p ); ?>
 				</div>
				 </div>
 			</div>
 		<?php endforeach; ?>
 	</div>
 	
 </div>