-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-shop.php
More file actions
139 lines (110 loc) · 3.31 KB
/
archive-shop.php
File metadata and controls
139 lines (110 loc) · 3.31 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
get_header();
$taxonomy = 'variety';
$typeOf = !empty($_GET['type_of']) ? $_GET['type_of'] : null;
// Check pagination
$paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;;
$category = strtolower(single_cat_title( '', false ));
$postPerPage = get_option( 'posts_per_page' );
$args = array(
'post_type' => array( 'shop' ),
'order' => 'DESC',
'posts_per_page' => 99,
'paged' => $paged,
);
if ( !empty($typeOf) ) :
$args['meta_query'] = array(
array(
'key' => 'ais_shop_' . $typeOf,
'value' => '1'
)
);
endif;
$the_query = new WP_Query( $args );
?>
<section id="archive">
<section class="container">
<div class="col-md-12 nopad">
<?php ais_breadcrumb( 'shop' ); ?>
</div>
<div class="col-md-12 nopad">
<?php
if ( $the_query->have_posts() ) :
?>
<div id="timeline" class="row archive-item" data-columns>
<?php
while ( $the_query->have_posts() ) : $the_query->the_post();
$promotion = get_post_meta( get_the_ID(), 'ais_shop_promotion' );
$recommendation = get_post_meta( get_the_ID(), 'ais_shop_recommendation' );
?>
<article id="entry-block" class="item card-item">
<div class="entry-image-container">
<a href="<?php the_permalink(); ?>">
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail( 'xx-landscape', array( 'class' => 'img-responsive' ) );
endif;
?>
</a>
<?php if ( !empty($promotion[0]) && $promotion[0] == '1' ) : ?>
<div class="entry-label-side">
Promotion
</div>
<?php endif; ?>
<?php if ( !empty($recommendation[0]) && $recommendation[0] == '1' ) : ?>
<div class="entry-label-top-side">
<i class="fa fa-thumbs-o-up"></i>
</div>
<?php endif; ?>
</div>
<div class="entry-content-container">
<h3 class="entry-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h3>
<div class="entry-notes text-left">
<span class="fa fa-tags"></span>
<?php
$term_list = wp_get_post_terms(get_the_ID(), $taxonomy, array("fields" => "all"));
foreach ($term_list as $term_single) :
?>
<a href="<?php echo get_term_link( $term_single->slug, $taxonomy ); ?>"><?php echo $term_single->name; ?></a>
<?php
endforeach;
?>
</div>
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
</div>
</article>
<?php
endwhile;
?>
<div class="loader hide"> Loading ... </div>
</div>
<?php
else :
?>
<div class="row">
<div class="text-center">
<h2 class="no-post-found">Sorry, no posts match with your criteria.</h2>
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-search">
<i class="fa fa-search"></i>
</button>
</form>
</div>
</div>
<?php endif; ?>
</div>
</section>
</section>
<?php
get_template_part( 'layouts-templates/layout', 'above_footerbar' );
get_footer();
?>