-
Notifications
You must be signed in to change notification settings - Fork 0
/
taxonomy-website_filter.php
119 lines (86 loc) · 2.05 KB
/
taxonomy-website_filter.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
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
<?php
/**
* The template for displaying all single posts and pages
*
* @package una
* @since una 1.0.3
* @license GPL 2.0
*
*/
get_header();
global $wp;
?>
<?php if (have_posts()): ?>
<section class="Taxonomy">
<div class="Filter">
<div class="Intro">
Filter by
</div>
<div class="List">
<?
$terms = get_terms(
array(
'taxonomy' => 'website_filter',
'hide_empty' => true,
)
);
if ( ! empty( $terms ) && is_array( $terms ) ):
foreach ( $terms as $term ):
$term_link = get_term_link( $term);
$current_url = home_url(add_query_arg(array(), $wp->request));
?>
<a class="Tag
<?php
if($current_url === $term_link)
echo 'is-active'
?>" href="<?php echo esc_url( get_term_link( $term ) ) ?>">
<?php echo $term->name; ?>
</a>
<?php
endforeach;
endif;
?>
</div>
</div>
<div class="Grid">
<?php while (have_posts()):
the_post(); ?>
<article class="inspoCard">
<a href="<?php the_field(
"url"
); ?>?ref=inspo.wannad.it" target="_blank">
<div class="Preview">
<div class="Bar">
<div class="Dot Red"></div>
<div class="Dot Yellow"></div>
<div class="Dot Green"></div>
</div>
<div class="Thumb">
<?php the_post_thumbnail("medium"); ?>
<div class="Overlay">
Visit↗
</div>
</div>
</div>
</a>
<a href="<?php the_permalink(); ?>">
<div class="Data">
<div class="Title">
<?php the_title(); ?>
</div>
<div class="Time">
<?php echo esc_html(
human_time_diff(
get_the_time("U"),
current_time("timestamp")
)
) . " ago"; ?>
</div>
</div>
</a>
</article>
<?php endwhile;?>
</section>
<?php endif; ?>
<?php get_footer();
?>