-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsearch.php
More file actions
129 lines (95 loc) · 2.03 KB
/
search.php
File metadata and controls
129 lines (95 loc) · 2.03 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
/**
* Search Page
* by Philip M. Hofer (Frumph)
* http://frumph.net/
*
* Content for the Search page.
*
* @package Comicpress
*/
get_header();
$count = 'No';
if ( have_posts() ) :
$count = $wp_query->found_posts;
?>
<h2 class="page-title">
<?php
esc_attr_e( 'Search for ‘', 'comicpress' );
the_search_query();
esc_attr_e( '’', 'comicpress' );
?>
</h2>
<div class="searchresults">
<?php
printf(
/* translators: %d: Number of found results */
esc_attr( _n( '%d result', '%d results', $count, 'comicpress' ) ),
esc_attr( $count )
);
?>
</div>
<div class="clear"></div>
<?php
if ( comicpress_themeinfo( 'display_archive_as_links' ) ) {
?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="entry">
<table class="archive-table">
<?php
while ( have_posts() ) :
the_post();
?>
<tr>
<td class="archive-date">
<?php the_time( _x( 'M d, Y', 'search page table date format', 'comicpress' ) ); ?>
</td>
<td class="archive-title">
<a href="<?php echo esc_url( get_permalink( $post->ID ) ); ?>" rel="bookmark" title="<?php esc_attr_e( 'Permanent Link:', 'comicpress' ); ?> <?php the_title(); ?>">
<?php the_title(); ?>
</a>
</td>
</tr>
<?php
endwhile;
?>
</table>
</div>
<div class="post-foot"></div>
</div>
<?php
} else {
while ( have_posts() ) :
the_post();
$post_format = ( $post->post_type !== 'post' ) ? $post->post_type : get_post_format();
get_template_part( 'content', $post_format );
endwhile;
}
?>
<div class="clear"></div>
<?php
comicpress_pagination();
else :
?>
<div class="post post-search uentry type-page">
<div class="post-head"></div>
<div class="post-content">
<div class="entry">
<h3>
<?php esc_html_e( 'No results found.', 'comicpress' ); ?>
</h3>
<p>
<?php esc_html_e( 'Try another search?', 'comicpress' ); ?>
</p>
<p>
<?php get_search_form(); ?>
</p>
</div>
</div>
<div class="post-foot"></div>
</div>
<?php
endif;
get_footer();
?>