-
Notifications
You must be signed in to change notification settings - Fork 13
/
search.php
66 lines (50 loc) · 1.46 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* Search tempalte
**/
get_header();
?>
<div class="page-header">
<div class="container">
<div class="text-column">
<h1 class="page-title"><?php esc_html_e( 'Search', 'knd' );?></h1>
</div>
</div>
<div class="widget-full widget_search search-holder">
<?php get_search_form();?>
<div class="sr-num"><?php printf( _n( '%s result', '%s results', (int) $wp_query->found_posts, 'knd' ), (int) $wp_query->found_posts );?></div>
</div>
</div>
<div class="main-content container search-loop">
<?php if ( have_posts() ) { ?>
<div class="text-column">
<?php
while ( have_posts() ) {
the_post();
$post_type_object = get_post_type_object(get_post_type());
$post_meta = $post_type_object->labels->singular_name;
$excerpt = apply_filters( 'knd_the_title', knd_get_post_excerpt( $post, 40, true ) );
?>
<article class="tpl-search">
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" class="entry-link"><?php the_title();?></a>
</h2>
<div class="entry-meta"><?php echo esc_html( $post_meta ); ?></div>
<div class="entry-summary"><?php echo esc_html( $excerpt );?></div>
</article>
<?php
}
?>
</div>
<?php knd_posts_pagination(); ?>
<?php } else { ?>
<div class="text-column">
<article class="tpl-search">
<div class="entry-summary">
<p><?php esc_html_e( 'Nothing found under your request', 'knd' ); ?></p>
</div>
</article>
</div>
<?php } ?>
</div>
<?php get_footer();