This repository was archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsearch.php
More file actions
executable file
·102 lines (72 loc) · 3.01 KB
/
search.php
File metadata and controls
executable file
·102 lines (72 loc) · 3.01 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/**
* The template for displaying Search Results pages
*
* @package Wonder
* @link https://themebeans.com/themes/wonder
*/
get_header();
wonder_blog_sidebar_loader(); ?>
<?php
// FEATURED IMAGE, IF FULLWIDTH BLOG
$bean_blog_sidebar_location = get_theme_mod( 'blog_sidebar_selector' );
if ( $bean_blog_sidebar_location === 'none' ) {
$thumbnail = 'post-full';
} else {
$thumbnail = 'post-feat';
} // END $bean_blog_sidebar_location
?>
<div id="primary-container" class="fadein">
<div class="row">
<form id="searchform" class="searchform" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="clearfix default_searchform results">
<input type="text" name="s" class="s" onblur="if (this.value == '') {this.value = '<?php esc_html_e( 'To search again, click here, type & hit enter... ', 'wonder' ); ?>';}" onfocus="if (this.value == '<?php esc_html_e( 'To search again, click here, type & hit enter... ', 'wonder' ); ?>') {this.value = '';}" value="<?php esc_html_e( 'To search again, click here, type & hit enter... ', 'wonder' ); ?>" />
<button type="submit" class="button"></button>
</div><!-- END .clearfix defaul_searchform -->
</form><!-- END #searchform -->
<div class="<?php echo esc_attr( $bean_blog_content_class ); ?> mobile-four">
<?php
global $query_string;
query_posts( $query_string . '&posts_per_page=' . get_option( 'posts_per_page' ) . '' );
?>
<?php
// IF SEARCH RESULTS
if ( have_posts() ) {
$i = 0;
// THE LOOP
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
$format = get_post_format();
if ( false === $format ) {
$format = 'standard'; }
if ( $format == 'aside' || $format == 'gallery' || $format == 'image' || $format == 'link' || $format == 'quote' || $format == 'video' ) {
}
get_template_part( 'inc/post-formats/content' );
endwhile;
endif;
} // IF NO SEARCH RESULTS
else {
?>
<h1 class="entry-title"><?php printf( __( 'Nothing Found.', 'wonder' ), get_search_query() ); ?></h1>
<p><?php printf( __( 'Sorry, we couldn't find anything for "%s".', 'wonder' ), get_search_query() ); ?></p>
<?php } // END IF NO RESULTS ?>
<div class="pagination index">
<span class="page-previous">
<?php next_posts_link( '' ); ?>
</span><!-- END .nav-previous -->
<span class="page-next">
<?php previous_posts_link( '' ); ?>
</span><!-- END .nav-next -->
</div><!-- END .pagination index -->
</div><!-- END $bean_blog_content_class -->
<?php if ( $bean_blog_sidebar_location === 'left' || $bean_blog_sidebar_location === 'right' ) { ?>
<div class="<?php echo esc_attr( $bean_blog_sidebar_class ); ?> hide-for-small">
<aside class="sidebar " role="complementary">
<?php dynamic_sidebar( 'internal-sidebar' ); ?>
</aside><!-- END .sidebar -->
</div><!-- END $bean_blog_sidebar_class -->
<?php } // END SIDEBAR LEFT OR RIGHT ?>
</div><!-- END .row -->
</div><!-- END #primary-container -->
<?php get_footer(); ?>