<?php
/**
 * Template Name: Home
*/

get_header(); ?>
	

<div id="home-video">
	 <?php 
    $video = get_field("home_video");
    $poster = get_field("poster"); ?>
       
    
    <?php if($video) {?>
    
            <video autoplay="" class="video-main" loop="" muted="" playsinline=""
                   poster="<?php echo $poster; ?>">
                <source src="<?php echo $video; ?>"
                        type="video/mp4">
            </video>
    <?php } else { ?>
    <img src="<?php echo $photo; ?>" alt="<?php bloginfo('name'); ?>" class="posterimg"/>
    <?php } ?>
              


<div class="onvideo-logos">
      <img src="<?php bloginfo ('template_url')?>/images/onvideo.png" alt="<?php bloginfo('name'); ?>" />
</div><!--onvideo-logos-->

<div class="video-bottom">
	<div class="inner">
    <div class="img-holder">
    <img src="<?php bloginfo ('template_url')?>/images/video_buttom.png" alt="<?php _e( 'About', 'themelang' )?>" />    
    </div>
	<div class="vb-title"><?php the_field('vb_title') ?></div>
    </div><!--inner-->
  
</div><!--bottom-->

 </div><!--home-video-->  
 
 
 <div id="content-section" class="section">
<div class="container">
	<div class="padding">
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                         <div class="entry">
                         
						 <?php the_content(); ?>
                         </div><!--entry-->
<?php endwhile;
		endif;
		wp_reset_query();
			?>
    </div><!--padding-->

</div><!--container-->
</div><!--section-->  


 <div id="blue-content-section">
	<div class="flex">
    	<?php if(get_field('bc_img')) {?>
    		<div class="bc-img">
            	<img src="<?php the_field('bc_img')?>" alt="<?php the_field('img_alt')?>" />
            </div><!--bc-img-->
        <?php } ?>
        <div class="bc-content">
        <div class="entry">
			<?php the_field('home_content')?>
            </div><!--entry-->
        </div><!--content-->
        
    </div><!--flex-->
</div><!--section-->  
 
  
   
<div id="v-slider-section">

<h1 class="home-title split"><?php the_field('boxes_title'); ?></h1>
<div class="v-slider">
	 <?php  get_template_part('parts/home/accordion-v'); ?> 

</div><!--v-slider-->

</div><!--section--> 

<div id="news" class="section">
<div class="container">

	  <div class="title split"><?php the_field('news_sec_title'); ?></div>
        <?php  get_template_part('parts/home/important_boxes'); ?>  
    

</div><!--container-->
</div><!--section-->        


<div id="events" class="section">
<div class="container">
	<div class="sec-heading flex">
	  <div class="title split"><?php the_field('events_sec_title'); ?></div>
      <?php if (get_field('all_events_link')) {?>
      <div  class="all-btn">
      <a href="<?php the_field('all_events_link'); ?>">
      	<?php _e( 'All Events', 'themelang' )?>
      </a>
      </div>
      <?php } ?>
      </div><!--flex-->
      <div class="row">
    <?php

wp_reset_query();


$lang = get_the_lang();
if($lang = 'he') {
	$cat = '115';
} else {
	$cat = '113';
}




	$args = array(
	'post_type' => 'post',
	'post_status' =>'publish',
	'posts_per_page' => '3',
	'cat' => $cat,
		);

	$t_query = new WP_Query($args);
	
	
	if ( $t_query->have_posts() ): while ( $t_query->have_posts() ): $t_query->the_post(); ?>
    	<div class="col-lg-4">
        <?php  get_template_part('parts/articlesloop'); ?>  
        </div><!--col-->
     
    	<?php endwhile;
		endif;
		wp_reset_query();
		?>
    </div><!--row-->			

</div><!--container-->
</div><!--section--> 

 <?php if(get_the_lang() =='en') {?>
<div id="publications" class="section">
<div class="container">
	<div class="sec-heading flex">
	  <div class="title split"><?php the_field('publications_sec_title'); ?></div>      
      <?php if (get_field('all_pub_link')) {?>
      <div  class="all-btn">
      <a href="<?php the_field('all_pub_link'); ?>">
      	<?php _e( 'All Publications', 'themelang' )?>
      </a>
      </div>
      <?php } ?>
      </div><!--flex-->
      
        <?php  get_template_part('parts/home/pub-loop'); ?>  
    

</div><!--container-->
</div><!--section-->           
<?php } //if en ?>


<?php  get_footer(); ?>