-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.php
47 lines (38 loc) · 1.43 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
<?php get_header(); ?>
<!-- PAGE START -->
<div id="page" class="clearfix">
<div id="container">
<div id="content" role="main">
<?php if ( have_posts() ) { ?>
<h1 class="page-title">Search Results for <?php $key = esc_html($s, 1); _e('<span class="alt search-terms">'); echo $key; _e('</span>'); ?></h1>
<span class="sub-title">Showing results <strong><?php
/* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $total_count = $allsearch->post_count; _e(''); wp_reset_query();
$post_count = get_query_var('posts_per_page');
$current_page = get_query_var('paged');
if($current_page > 0)
$current_page = $current_page - 1;
$start = $current_page * $post_count;
$end = $start + $post_count;
if ($end>$total_count)
$end = $total_count;
echo $start . '‐' . $end; ?></strong> of <strong><?php echo $total_count; ?></strong>.</span>
<?php } ?>
<?php do_action('before_content'); ?>
<?php if ( have_posts() ) :
$post_index = 1;
while ( have_posts() ) : the_post();
$posts_displayed[] = $post->ID;
get_template_part( 'content', get_post_format() );
$post_index = $post_index + 1;
endwhile;
stf_pagination();
else : ?>
<?php get_template_part( 'content', '404' ); ?>
<?php endif; ?>
<?php do_action('after_content'); ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div>
<!--/ PAGE END -->
<?php get_footer(); ?>