-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
78 lines (56 loc) · 2.03 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
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* The template for displaying search results pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Sobre Lite
*/
get_header(); ?>
<?php
$bg_image = sobre_lite_get_option('search_heading_image');
?>
<!-- Page Title -->
<section class="page-title text-center"
<?php if($bg_image){ echo 'style="background-image: url('.esc_url($bg_image).');"';}?>>
<div class="container relative clearfix">
<div class="title-holder">
<div class="title-text">
<h1><?php printf( esc_html__( 'Search Results for: %s', 'sobre-lite' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</div>
</div>
</div>
</section> <!-- end page title -->
<?php if ( have_posts() ) : ?>
<!-- Blog -->
<section class="section-wrap">
<div class="container-fluid semi-fluid">
<div class="row blog-content">
<div id="isotope-grid" class="works-grid grid-4-col gutter">
<?php while ( have_posts() ) : the_post();?>
<?php get_template_part( 'template-parts/content', get_post_format() );?>
<?php endwhile;?>
</div>
</div>
<?php if(sobre_lite_get_option('blog_nav_type','ajax') == 'ajax'):?>
<!-- Ajax Navigation -->
<?php if($wp_query->max_num_pages > 1):?>
<div class="row mt-40">
<div class="col-md-12 text-center">
<a href="#" class="btn btn-lg btn-light" id="load-more"><span><?php esc_html_e('Load More', 'sobre-lite');?></span></a>
<input id="query" type="hidden" value="<?php echo esc_js(json_encode($wp_query->query)); ?>">
<input id="max_pages" type="hidden" value="<?php echo esc_js($wp_query->max_num_pages); ?>">
</div>
</div>
<?php endif; ?>
<?php else: ?>
<!-- Standart WP Navigation -->
<?php the_posts_navigation();?>
<?php endif; ?>
</div>
</section> <!-- end Blog -->
<?php else :?>
<?php get_template_part( 'template-parts/content', 'none' );?>
<?php endif;?>
<?php
get_footer();