-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
76 lines (56 loc) · 2.67 KB
/
search.php
File metadata and controls
76 lines (56 loc) · 2.67 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
<?php get_header(); ?>
<div id="primary" class="site-content">
<header class="page-header centering_box">
<h1 class="page-title"><?php printf( __( '<span class="search_query_title">Search Results for: </span>%s', 'arenson' ), get_search_query() ); ?></h1>
<hr />
</header>
<div id="content" class="centering_box" role="main">
<?php if ( have_posts() ) : ?>
<div class="search_filter">
<? if(count($results_terms)>0) { ?>
<ul>
<? foreach($results_terms as $ter) { ?>
<li class="<? echo $ter->taxonomy ?>"><a href="<?php echo str_replace( '%7E', '~', $_SERVER['PHP_SELF']); ?>?s=<? echo get_search_query() ?>&tx=<? echo $ter->taxonomy ?>&tn=<?echo $ter->slug ?>"><? echo $ter->name ?></a></li>
<? } ?>
</ul>
<? } ?>
</div>
<div class="searchresults grid-form">
<?php $count = 1; $list_num = ''; ?>
<?php while ( have_posts() ) : the_post();
if ($count % 3 == 0) { $list_num = 'third'; }
if ($count % 2 == 0) { $list_num .= ' even'; }
$item = false;
$feat_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) , 'product_overviews');
$has_feat = ($feat_img != null);
$feat_img_src = ($feat_img != null) ? reset($feat_img) : get_bloginfo('template_url') . '/images/search_default.jpg';
$post_terms = get_product_breadcrumb(true);
if(!empty($post_terms)) {
$post_terms = array_reverse($post_terms);
$item = get_term_by( 'id', reset($post_terms), 'p_cat');
}
?>
<div class="tile result one_product terminal_product_overview <? if(!$has_feat) echo 'no_image' ?> <? echo $list_num; ?>">
<div class="item_image">
<a title="See more about <? the_title() ?>" href="<? echo get_permalink() ?>"><img src="<? echo $feat_img_src ?>" alt="<? the_title() ?>" alt="Click to see more about <? the_title() ?>" /></a>
</div>
<div class="post_title">
<a title="See more about <? the_title() ?>" href="<? echo get_permalink() ?>"><? the_title() ?></a>
</div>
<? if($item) { ?>
<div class="product_division division_<? echo $item->slug; ?>"><span class="icon"></span> <? echo $item->name; ?></div>
<? } ?>
</div>
<?php $list_num = ''; $count++; endwhile; ?>
<div class="clearfix"></div>
<?php arenson_content_nav( 'nav-below' ); ?>
<?php else : ?>
<div class="entry-content">
<h3>Sorry, but nothing was found.</h3>
<?php get_search_form(); ?>
</div>
<?php endif; ?>
</div>
</div><!-- #content -->
</div><!-- #primary .site-content -->
<?php get_footer(); ?>