Нет описания

search.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * The template for displaying search results pages
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
  6. *
  7. * @package XShop
  8. */
  9. $xshop_blog_container = get_theme_mod( 'xshop_blog_container', 'container' );
  10. $xshop_lite_blog_layout = get_theme_mod( 'xshop_lite_blog_layout', 'leftside' );
  11. $xshop_lite_blog_style = get_theme_mod( 'xshop_lite_blog_style', 'list' );
  12. if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout != 'fullwidth' ) {
  13. $xshop_blog_column = 'col-lg-9';
  14. }else{
  15. $xshop_blog_column = 'col-lg-12';
  16. }
  17. get_header();
  18. ?>
  19. <div class="<?php echo esc_attr($xshop_blog_container); ?> mt-5 mb-5 pt-5 pb-5">
  20. <div class="row">
  21. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout == 'leftside' ): ?>
  22. <div class="col-lg-3">
  23. <?php get_sidebar(); ?>
  24. </div>
  25. <?php endif; ?>
  26. <div class="<?php echo esc_attr($xshop_blog_column); ?>">
  27. <main id="primary" class="site-main">
  28. <?php if ( have_posts() ) : ?>
  29. <header class="page-header search-header shadow p-4 mb-5 text-center">
  30. <h1 class="page-title">
  31. <?php
  32. /* translators: %s: search query. */
  33. printf( esc_html__( 'Search Results for: %s', 'xshop-lite' ), '<span>' . get_search_query() . '</span>' );
  34. ?>
  35. </h1>
  36. </header><!-- .page-header -->
  37. <?php if( $xshop_lite_blog_style == 'grid' ): ?>
  38. <div class="bplus-gridh mb-5">
  39. <div class="grid row" data-masonry='{"percentPosition": true }'>
  40. <?php endif; ?>
  41. <?php
  42. /* Start the Loop */
  43. while ( have_posts() ) :
  44. the_post();
  45. /**
  46. * Run the loop for the search to output the results.
  47. * If you want to overload this in a child theme then include a file
  48. * called content-search.php and that will be used instead.
  49. */
  50. get_template_part( 'template-parts/content', 'search' );
  51. endwhile;
  52. ?>
  53. <?php if( $xshop_lite_blog_style == 'grid' ): ?>
  54. </div>
  55. </div>
  56. <?php endif; ?>
  57. <?php
  58. the_posts_navigation();
  59. else :
  60. get_template_part( 'template-parts/content', 'none' );
  61. endif;
  62. ?>
  63. </main><!-- #main -->
  64. </div>
  65. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout == 'rightside' ): ?>
  66. <div class="col-lg-3">
  67. <?php get_sidebar(); ?>
  68. </div>
  69. <?php endif; ?>
  70. </div>
  71. </div>
  72. <?php
  73. get_footer();