<?php /* Template Name: Video Search */

get_header(); ?>

<?php

  if($_GET['search_video'] && !empty($_GET['search_video']))
  {
    $text = $_GET['search_video'];
  }

  if($_GET['post_type'] && !empty($_GET['post_type']))
  {
    $type = $_GET['post_type'];
  }

  global $wp_query;
  $total_results = $wp_query->found_posts;

 ?>

<?php get_template_part( 'snippet', 'header-video-slider' ); ?>


<div id="content">

    <div id="video-category" class="container">

      <div class="row">
        <h3>Search Result for : <?php echo "$text"; ?> </h3>

        <?php

        $args = array(
            'post_type'=> $type,
            's'    => $text,
            'posts_per_page' => -1,
            );
        $loop = new WP_Query( $args );
        while ( $loop->have_posts() ) : $loop->the_post();
        the_title();
        echo '<div class="entry-content">';
        the_excerpt();
        echo '</div>';
        endwhile;

         ?>


      </div>
    </div>

</div>

<?php get_footer(); ?>