-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
executable file
·74 lines (53 loc) · 2.44 KB
/
Copy pathsearch.php
File metadata and controls
executable file
·74 lines (53 loc) · 2.44 KB
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
<?php
/**
* The template for displaying search results
*
* @package Reactor
* @subpackage Templates
* @since 1.0.0
*/
?>
<?php get_header(); ?>
<div id="primary" class="site-content">
<?php reactor_content_before(); ?>
<div id="content" role="main">
<div class="row">
<div class="<?php reactor_columns(); ?>">
<?php reactor_inner_content_before(); ?>
<?php if ( have_posts() ) :
$results_total = $wp_query->found_posts;
if ( $paged == 0 ) {
$results_first = 1;
$results_last = $wp_query->query_vars['posts_per_page'];
} else {
$results_first = 1 + ($wp_query->query_vars['posts_per_page'] * ( $paged - 1 ) );
if ( $wp_query->post_count == $wp_query->query_vars['posts_per_page'] ) {
$results_last = $wp_query->query_vars['posts_per_page'] * ( $paged );
} else {
$results_last = ( $wp_query->query_vars['posts_per_page'] * ( $paged - 1 ) ) + $wp_query->post_count;
}
}
$entries = ( $wp_query->post_count == 1 ) ? 'entry' : 'entries';
?>
<?php reactor_loop_before(); ?>
<header class="page-header">
<h1 class="page-title"><span class="searchresults">Showing <?php echo $entries; ?> <strong><?php echo $results_first; ?></strong> <?php if ( $wp_query->post_count != 1 && $paged != 1 ): ?> to <strong><?php echo $results_last; ?></strong> <?php endif; ?>(of <?php echo $results_total; ?>) for</span> <?php echo get_search_query(); ?></h1>
</header>
<?php // start the loop
while ( have_posts() ) : the_post(); ?>
<?php // get post format and display template for that format
if ( !get_post_format() ) : get_template_part('post-formats/format', 'catpage');
else : get_template_part('post-formats/catpage', get_post_format()); endif; ?>
<?php endwhile; ?>
<?php reactor_loop_after(); ?>
<?php // if no posts are found
else : reactor_loop_else(); ?>
<?php endif; // end have_posts() check ?>
<?php reactor_inner_content_after(); ?>
</div><!-- .columns -->
<?php get_sidebar(); ?>
</div><!-- .row -->
</div><!-- #content -->
<?php reactor_content_after(); ?>
</div><!-- #primary -->
<?php get_footer(); ?>