-
Notifications
You must be signed in to change notification settings - Fork 40
/
search.php
executable file
·51 lines (45 loc) · 1.66 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
<?php
global $wp_query;
$big = 999999999;
?>
<?php get_header(); ?>
<main id="content" class="clearfix" role="main">
<section>
<header>
<h1 class="page-title"><?php printf( __( 'Search Results: %s', '' ), '<span class="page-title__query-term">' . get_search_query() . '</span>' ); ?></h1>
</header>
<?php if ( have_posts() ) : ?>
<ul class="search-results">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php else : ?>
<p><?php _e( 'Sorry, your search term(s) did not find any matches within our database. Please do try again won\'t you pretty please ?','wpflex' ); ?></p>
<?php endif; ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<div class="pagination">
<?php
echo paginate_links( array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
'format' => '?paged=%#%',
'total' => $wp_query->max_num_pages,
'current' => max( 1, get_query_var( 'paged' ) ),
'show_all' => False,
'end_size' => 1,
'mid_size' => 2,
'prev_next' => True,
'prev_text' => __('<span id="prev">« Previous</span>'),
'next_text' => __('<span id="nxt">Next »</span>'),
'type' => 'plain',
'add_args' => False,
'add_fragment' => ''
));
?>
</div>
<?php endif; ?>
</section>
</main>
<?php get_template_part( 'inc/widget-sidebar' ); ?>
<?php get_footer(); ?>