forked from okfde/jh-lauch-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pojects-overview.php
178 lines (159 loc) · 5.68 KB
/
pojects-overview.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/**
* Template Name: Projekt Übersicht
*/
get_header();
?>
<?php
while ( have_posts() ) : the_post(); ?>
<div class="p-r">
<header class="c-page-offcenter-header">
<h1 class="c-page-title"><?php the_title() ?></h1>
<div class="c-page-excerpt"><?php the_content() ?></div>
<div class="c-page-header-illustration">
<img src="<?php echo get_field('illustration_right'); ?>" alt="" width="120">
</div>
</header>
</div>
<?php
endwhile; ?>
<section class="pt-5 pb-2 needs-js">
<h2 class="c-uppercase-title"><?php echo __('Filtern nach', 'lauch') ?></h2>
<div class="c-filter">
<?php $taxonomies = array(array('Ort', 'location'),
array('Jahr', 'year'),
array('Thema', 'topics'),
array('Technik', 'tech'));
foreach ($taxonomies as $tax) : ?>
<label class="c-filter-item" for="filter-<?php echo $tax[1] ?>">
<span class="a11y-visuallyhidden"><?php echo __($tax[0], 'lauch') ?></span>
<select id="filter-<?php echo $tax[1] ?>">
<option value=""><?php echo __($tax[0], 'lauch') ?></option>
<?php $terms = get_terms(array('taxonomy' => $tax[1], 'childless' => true));
foreach ($terms as $t) : ?>
<option value="<?php echo $t->taxonomy; ?>-<?php echo $t->slug; ?>"><?php echo $t->name; ?></option>
<?php endforeach; ?>
</select>
</label>
<?php endforeach; ?>
</div>
</section>
<section class="c-page-section c-project-list pb-0 pt-5">
<ul class="js-isotope">
<?php
$args = array('post_type' => 'video',
'posts_per_page' => 4,
'tax_query' => array(
array(
'taxonomy' => 'year',
'field' => 'slug',
'terms' => date("Y"),
),
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'project-presentation',
)
),);
$the_query = new WP_Query( $args );
$arr_collect_ids = []; ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php
get_template_part( 'template-parts/children', 'project' );
array_push($arr_collect_ids, get_the_ID()); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
<li class="fullwidth--padding needs-js">
<?php
$loc_term = get_field('term_location');
$year_term = get_field('term_year');
$topic_term = get_field('term_topics');
$tech_term = get_field('term_tech');
$out = "[vuevideo type='project-presentation' ";
if ($loc_term) {
$out .= "location='". $loc_term->slug ."' ";
}
if ($year_term) {
$out .= "year='". $year_term->slug ."' ";
}
if ($tech_term) {
$out .= "tech='". $tech_term->slug ."' ";
}
if ($topic_term) {
$out .= "topics='". $topic_term->slug ."' ";
}
$out .= "]";
echo do_shortcode($out); ?>
</li>
<?php
$args = array('post_type' => 'video',
'posts_per_page' => 8,
'post__not_in' => $arr_collect_ids,
'tax_query' => array(
array(
'taxonomy' => 'year',
'field' => 'slug',
'terms' => date("Y"),
),
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'project-presentation',
)
));
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php
get_template_part( 'template-parts/children', 'project' );
array_push($arr_collect_ids, get_the_ID()); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
<li class="c-catnav fullwidth needs-js">
<h2 class="c-catnav-title"><?php echo __('Spannende Themen', 'lauch') ?></h2>
<nav>
<div class="tns-controls">
<button class="tns-prev" title="Nach links"><?php render_svg('/images/icons/arrow-left.svg'); ?></button>
<button class="tns-next" title="Nach rechts"><?php render_svg('/images/icons/arrow-right.svg') ?></button>
</div>
<ul class="js-filter-parent js-slider">
<?php $terms = get_terms('topics', array('hide_empty' => true));
foreach ($terms as $t) : ?>
<li class="c-catnav-item">
<a href="#"
data-filter="<?php echo $t->slug; ?>"
class="hover-line-trigger">
<h3><span class="hover-line"><?php echo $t->name; ?></span></h3>
<p><?php echo $t->description; ?></p>
</a>
</li>
<?php endforeach; ?>
</ul>
</nav>
</li>
<?php
$args = array('post_type' => 'video',
'posts_per_page' => -1,
'post__not_in' => $arr_collect_ids,
'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => 'type',
'field' => 'slug',
'terms' => 'project-presentation',
)));
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<?php
get_template_part( 'template-parts/children', 'project' ) ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</ul>
</section>
<?php
get_footer();