tatdat171

search-form.php

Jul 3rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.71 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Search Page chuyen muc 1
  4. */
  5.  
  6.  
  7. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  8.  
  9. global $king;
  10.  
  11. get_header();
  12.  
  13. ?>
  14.  
  15.     <?php $king->breadcrumb(); ?>
  16.    
  17.     <div id="primary" class="site-content container-content content ">
  18.         <div id="content" class="row row-content container">
  19.             <div class="col-md-9">
  20.                 <?php
  21.                 if (isset($_GET["cat"]) && isset($_GET["s"])) {
  22.                     $catId = $_GET["cat"];
  23.                     $args = array(
  24.                         'cat' => $catId,
  25.                         's' =>$string
  26.                        
  27.                     );
  28.                         // The Query
  29.                     $the_query = new WP_Query( $args );
  30.                 ?>
  31.  
  32.                 <?php if ( have_posts() ) : ?>
  33.                     <?php /* Start the Loop */ ?>
  34.                     <?php while ( have_posts() ) : the_post(); ?>
  35.    
  36.                         <?php
  37.                             get_template_part( 'content' );
  38.                         ?>
  39.    
  40.                     <?php endwhile; ?>
  41.    
  42.                     <?php king::pagination(); ?>
  43.    
  44.                 <?php else : ?>
  45.                     <br />
  46.                     <article id="post-0" class="post no-results not-found">
  47.                         <header>
  48.                             <h3 class="widget-title">
  49.                                 <?php _e( 'Nothing Found', 'arkahost' ); ?>
  50.                             </h3>
  51.                         </header><!-- .entry-header -->
  52.    
  53.                         <div class="entry-content">
  54.                             <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'arkahost' ); ?></p>
  55.                             <?php get_search_form(); ?>
  56.                         </div><!-- .entry-content -->
  57.                     </article><!-- #post-0 -->
  58.    
  59.                 <?php endif; } ?>
  60.                
  61.             </div>
  62.             <div class="col-md-3">
  63.                 <?php if ( is_active_sidebar( 'sidebar' ) ) : ?>
  64.                     <div id="sidebar" class="widget-area king-sidebar">
  65.                         <?php dynamic_sidebar( 'sidebar' ); ?>
  66.                     </div><!-- #secondary -->
  67.                 <?php endif; ?>
  68.             </div>
  69.         </div>
  70.     </div>
  71.  
  72.                
  73. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment