-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
65 lines (61 loc) · 1.79 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* The template for displaying search results pages.
*
* @package Ravon
*/
get_header();
$ravon_search_page_container = get_theme_mod( 'ravon_blog_archive_container', 'container' );
$ravon_blog_archive_column = get_theme_mod( 'ravon_blog_archive_column', '2' );
$class = '';
switch ( $ravon_blog_archive_column ) {
case '1':
$class .= 'row row-cols-1';
break;
case '2':
default:
$class .= 'row row-cols-1 row-cols-sm-2';
break;
case '3':
$class .= 'row row-cols-1 row-cols-lg-3 row-cols-sm-2';
break;
case '4':
$class .= 'row row-cols-1 row-cols-xl-4 row-cols-lg-3 row-cols-sm-2';
break;
case '5':
$class .= 'row row-cols-1 row-cols-xl-5 row-cols-lg-3 row-cols-sm-2';
break;
case '6':
$class .= 'row row-cols-1 row-cols-xl-6 row-cols-lg-3 row-cols-sm-2';
break;
}
?>
<section class="search-result-wrapper-section">
<div class="<?php echo esc_attr( $ravon_search_page_container ); ?>">
<div class="row">
<div class="col">
<?php printf( '<h1 class="page-title">%1$s <span>%2$s</span></h1>', esc_html__( 'Search Results for:', 'ravon' ), get_search_query() ); ?>
</div><!-- .col -->
</div><!-- .row -->
</div><!-- .container -->
</section>
<section class="archive-wrapper-section">
<div class="<?php echo esc_attr( $ravon_search_page_container ); ?>">
<?php if ( have_posts() ) : ?>
<div class="<?php echo esc_attr( $class ); ?>">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content' ); ?>
<?php endwhile; ?>
</div>
<?php else : ?>
<div class="row row-cols-1">
<div class="col">
<?php get_template_part( 'template-parts/content', 'none' ); ?>
</div>
</div>
<?php endif; ?>
<?php get_template_part( 'template-parts/pagination' ); ?>
</div>
</section>
<?php
get_footer();