forked from starverte/flint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
59 lines (40 loc) · 1.35 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
<?php
/**
* The template for displaying Search Results pages.
*
* @package Flint
* @since 1.0.1
*/
get_header();
flint_get_sidebar( 'header' );
?>
<section id="primary" class="content-area container">
<div class="row">
<?php flint_get_sidebar( 'left' ); ?>
<div id="content" role="main" <?php flint_content_class(); ?>>
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h2 class="page-title"><?php printf( __( 'Search Results for: %s', 'flint' ), '<span>' . get_search_query() . '</span>' ); ?></h2>
</header><!-- .page-header -->
<?php while ( have_posts() ) : the_post(); ?>
<?php
$type = get_post_type();
if ( 'post' === $type ) {
get_template_part( 'format', get_post_format() );
} elseif ( 'page' === $type ) {
get_template_part( 'templates/' . flint_post_width(), 'content' );
} else {
get_template_part( 'type', get_post_type() );
}
?>
<?php endwhile; ?>
<?php flint_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'search' ); ?>
<?php endif; ?>
</div><!-- #content -->
<?php flint_get_sidebar( 'right' ); ?>
</div><!-- .row -->
</section><!-- #primary -->
<?php flint_get_sidebar( 'footer' ); ?>
<?php get_footer(); ?>