This repository was archived by the owner on Nov 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsearch.php
More file actions
66 lines (55 loc) · 1.87 KB
/
search.php
File metadata and controls
66 lines (55 loc) · 1.87 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
<?php
/**
* The template for displaying Search Results pages
*
* @package CWP
*/
get_header(); ?>
<main id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'c' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php $featured_image_url = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') ); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_single() ) : ?>
<h3><a><?php the_title(); ?></a></h3>
<?php else : ?>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php endif; // is_single() ?>
<div class="metadata">
<?php cwp_display_entry_meta( false ); ?>
</div><!--/metadata-->
<?php
if ($featured_image_url != NULL) {
echo '<div class="image" style="background-image: url(' .$featured_image_url .');"></div>';
}
?>
<div class="excerpt">
<?php
if ( has_excerpt() ) {
the_excerpt();
} else {
the_content();
}
?>
</div>
</div><!--/post-->
<?php endwhile; ?>
<?php cwp_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'cwp' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'cwp' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</main><!--/content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>