forked from nmynarcik/darkfalluw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
34 lines (34 loc) · 1.1 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
<?php get_header(); ?>
<div id="content">
<?php if ( have_posts() ) : ?>
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'darkfalluw' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
<?php get_template_part( 'nav', 'above' ); ?>
<?php while ( have_posts() ) : the_post() ?>
<?php
if(has_post_thumbnail()){
$default_attr = array(
'src' => $src,
'class' => "attachment",
'alt' => trim(strip_tags( $attachment->post_title )),
'title' => trim(strip_tags( $attachment->post_title )),
);
echo get_the_post_thumbnail($post->ID, array(50,50));
echo get_the_title() . '<br/>';
}else{
get_template_part( 'entry' );
}
?>
<?php endwhile; ?>
<?php get_template_part( 'nav', 'below' ); ?>
<?php else : ?>
<div id="post-0" class="post no-results not-found">
<h2 class="entry-title"><?php _e( 'Nothing Found', 'darkfalluw' ) ?></h2>
<div class="entry-content">
<p><?php _e( 'Sorry, nothing matched your search. Please try again.', 'darkfalluw' ); ?></p>
<?php get_search_form(); ?>
</div>
</div>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>