<?php
/**
 * The template for displaying search results
 *
 * @package WordPress
 * @subpackage MyArcadeTheme
 * @since 1.0.0
 */

get_header(); ?>

<div class="cont">

  <div class="cntcls" id="ajaxcat">
    <main class="main-cn cols-n9">
      <?php     
      $design = filter_input( INPUT_COOKIE, 'designcat', FILTER_VALIDATE_INT, array("options" => array( "default" => 3) ) );
      $order = filter_input( INPUT_COOKIE, 'ordercat', FILTER_VALIDATE_INT, array("options" => array( "default" => 1) ) );

      if ( have_posts() ) :
        ?>
        <div class="titl">
          <div><?php printf( __( 'Search Results for: %s', 'myarcadetheme' ), get_search_query() ); ?></div>
        </div>

        <ul class="lst-gams cate-grid">
          <?php
          // Generate query args
          global $query_string;

          query_posts( $query_string . myarcadetheme_mobile_tag() );

          while ( have_posts() ) : the_post();
            ?>
            <!--<game>-->
            <li>
              <div class="gmcn-midl">
                <figure class="gm-imag" itemprop="image">
                  <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" itemprop="url">
                    <?php myarcade_thumbnail( 148, 148 ); ?>
                  </a>
                </figure>

                <div class="gm-text">
                  <div class="gm-cate">
                    <?php echo get_the_category_list(' '); ?>
                  </div>

                  <div class="gm-titl" itemprop="name">
                    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" itemprop="url">
                      <?php the_title(); ?>
                    </a>
                  </div>

                  <?php myarcadetheme_rate_and_view(); ?>
                </div>
              </div>
            </li>
            <!--<game>-->
            <?php
          endwhile;
          ?>
        </ul>

        <?php myarcadetheme_navigation(); ?>
        <?php
      else :
        // Nothing found
        get_template_part( "partials/content", "none" );
      endif;
      ?>
    </main>

    <?php get_sidebar(); ?>
  </div>
</div>

<?php get_footer(); ?>