Advertisement
Guest User

wp-content/themes/Impreza/search.php

a guest
Mar 29th, 2021
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
  2.  
  3. /**
  4.  * The template for displaying search results pages
  5.  *
  6.  * Do not overload this file directly. Instead have a look at templates/search.php file in us-core plugin folder:
  7.  * you should find all the needed hooks there.
  8.  */
  9.  
  10. if ( function_exists( 'us_load_template' ) ) {
  11.  
  12.     us_load_template( 'templates/search' );
  13.  
  14. } else {
  15.     get_header();
  16.     ?>
  17.     <main id="page-content" class="l-main">
  18.         <section class="l-section">
  19.             <div class="l-section-h i-cf">
  20.                 <h1 class="page-title">
  21.                     <?php echo sprintf( us_translate( 'Search Results for &#8220;%s&#8221;' ), get_search_query() ); ?>
  22.                 </h1>
  23.                 <?php
  24.                 if ( have_posts() ) {
  25.  
  26.                     // Load posts loop
  27.                     while ( have_posts() ) {
  28.                         the_post();
  29.                         get_template_part( 'content' );
  30.                     }
  31.  
  32.                     // Pagination
  33.                     the_posts_pagination(
  34.                         array(
  35.                             'mid_size' => 3,
  36.                             'before_page_number' => '<span>',
  37.                             'after_page_number' => '</span>',
  38.                         )
  39.                     );
  40.  
  41.                 } else {
  42.                     echo us_translate( 'No results found.' );
  43.                 }
  44.                 ?>
  45.             </div>
  46.         </section>
  47.     </main>
  48.     <?php
  49.     get_footer();
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement