<?php get_header();?>
<section class="listing-sec">
 <div class="container"> 
  <div class="row">
  <?php
// Get data from URL into variables
   $_title = $_GET['title'] != '' ? $_GET['title'] : '';
   $_author = $_GET['author'] != '' ? $_GET['author'] : '';
   $_year = $_GET['year'] != '' ? $_GET['year'] : '';

if($_title != '')
{
  $v_args = array(
    'post_type'     =>  'book', 
    's'             =>  $_title
   );
}
elseif($_author != ''){
  $v_args = array(
    'post_type'     =>  'book', 
    'author' => $_author
   );
}
elseif($_year != ''){
  $v_args = array(
    'post_type'     =>  'book', 
    'meta_query'    =>  array(
      array(
          'key'     => 'publication', // assumed your meta_key is 'car_model'
          'value'   => $_year,
          'compare' => 'LIKE', // finds models that matches 'model' from the select field
      ),
  )
   );
}
elseif($_title != '' &&  $_author != '')
{
  $v_args = array(
    'post_type'     =>  'book', // your CPT
    'author' => $_author,
    's'             =>  $_title
);
}
elseif($_title != '' &&  $_year != '')
{
  $v_args = array(
    'post_type'     =>  'book',
    's'             =>  $_title,
    'meta_query'    =>  array(
      array(
          'key'     => 'publication', // assumed your meta_key is 'car_model'
          'value'   => $_year,
          'compare' => 'LIKE', // finds models that matches 'model' from the select field
      ),
  )
);
}
elseif($_author != '' &&  $_year != '')
{
  $v_args = array(
    'post_type'     =>  'book',
    'author' => $_author,
    'meta_query'    =>  array(
      array(
          'key'     => 'publication', // assumed your meta_key is 'car_model'
          'value'   => $_year,
          'compare' => 'LIKE', // finds models that matches 'model' from the select field
      ),
  )
);
}
else{
$v_args = array(
        'post_type'     =>  'book', // your CPT
        'author' => $_author,
        's'             =>  $_title, // looks into everything with the keyword from your 'name field'
        'meta_query'    =>  array(
                          array(
                              'key'     => 'publication', // assumed your meta_key is 'car_model'
                              'value'   => $_year,
                              'compare' => 'LIKE', // finds models that matches 'model' from the select field
                          ),
                      )
    );
  }
      $loop = new WP_Query( $v_args );
      if($loop->have_posts()) : while($loop->have_posts()) : $loop->the_post();
      ?>
       <p class="col-md-12 alert alert-success"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
      <?php  endwhile; ?>
      <?php else :  ?>
          <p class="col-md-12 alert alert-danger">No Result Found!</p>
      <?php endif; wp_reset_postdata(); ?>
  </div>
</div>
</section>
<?php get_footer(); ?>