-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
72 lines (53 loc) · 2.12 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
66
67
68
69
70
71
72
<?php
/**
* The template for displaying search results pages.
*
* @package Paul Component Engineering
*/
get_header(); ?>
<script>
jQuery(document).ready(function(){
jQuery('.portal').matchHeight();
});
</script>
<section id="primary" class="shop-portals content-area">
<?php if ( have_posts() ) : ?>
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'Paul Component Engineering' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
<div class="portal-container page-content">
<?php while ( have_posts() ) : the_post(); ?>
<div class="portal" id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink(); ?>">
<?php $mobile_page_banner = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'page-banner-mobile'); ?>
<?php $tablet_page_banner = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'page-banner-tablet'); ?>
<?php $desktop_page_banner = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'page-banner-desktop'); ?>
<?php $retina_page_banner = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'page-banner-retina'); ?>
<picture>
<!--[if IE 9]><video style="display: none"><![endif]-->
<source
srcset="<?php echo $mobile_page_banner[0]; ?>"
media="(max-width: 500px)" />
<source
srcset="<?php echo $tablet_page_banner[0]; ?>"
media="(max-width: 860px)" />
<source
srcset="<?php echo $desktop_page_banner[0]; ?>"
media="(max-width: 1180px)" />
<source
srcset="<?php echo $retina_page_banner[0]; ?>"
media="(min-width: 1181px)" />
<!--[if IE 9]></video><![endif]-->
<img srcset="<?php echo $image[0]; ?>">
</picture>
<h4>
<?php the_title(); ?>
</h4>
</a>
</div>
<?php endwhile; ?>
</div>
<?php basis_paging_nav(); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</section><!-- #primary -->
<?php get_footer(); ?>