-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-werkstatten.php
143 lines (109 loc) · 5.22 KB
/
page-werkstatten.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
<?php get_header(); ?>
<div class="container mt-5 mb-5">
<div class="row">
<div class="col">
<?php while (have_posts()) : the_post(); ?>
<h1><?php the_title() ?></h1>
<p>
<?php the_content(); ?>
</p>
<?php endwhile; ?>
</div>
</div>
</div>
<?php
$labs_main = get_terms(array(
'taxonomy' => 'ms_devices_workshop',
'hide_empty' => true,
'parent' => 0,
'orderby' => 'name',
'order' => 'ASC'
));
?>
<?php foreach ($labs_main as $lab_main) : ?>
<?php
$labs = get_terms(array(
'taxonomy' => 'ms_devices_workshop',
'hide_empty' => false,
'parent' => $lab_main->term_id,
'orderby' => 'name',
'order' => 'ASC'
));
if (count($labs) > 0) :
?>
<div class="container mt-5 mb-5">
<div class="row mb-3">
<div class="col d-flex justify-content-end">
</div>
</div>
<div class="row mb-2">
<div class="col text-justify">
<?php while (have_posts()) : the_post(); ?>
<h2><?php echo $lab_main->name; ?></h2>
<p>
<?php echo $lab_main->description; ?>
</p>
<?php endwhile; ?>
</div>
</div>
</div>
<div class="container mt-5 mb-5">
<div class="row mt-5 ms-device-list">
<?php
$labs = get_terms(array(
'taxonomy' => 'ms_devices_workshop',
'hide_empty' => false,
'parent' => $lab_main->term_id,
'orderby' => 'name',
'order' => 'ASC'
));
?>
<?php foreach ($labs as $lab) : ?>
<?php
$link = get_term_link($lab, 'ms_devices_workshop');
$term_image = get_term_meta($lab->term_id, "thumbnail", true);
?>
<a href="<?php echo $link; ?>" class="col-12 col-xl-4 col-md-6 text-dark" style="text-decoration: none;">
<div class="device-card mb-5 d-flex flex-column" style="cursor: pointer;">
<?php if (!empty($term_image)) : ?>
<div class="device-card-thumbnail" style="background-image: url(<?php echo $term_image ?>);"></div>
<?php elseif ($lab->name == "Digitalwerkstatt") : ?>
<div class="device-card-thumbnail" style="background-image: url(https://makerspace.experimenta.science/wp-content/uploads/2020/03/Digitalwerkstatt-scaled.jpg);"></div>
<?php elseif ($lab->name == "Elektronikwerkstatt") : ?>
<div class="device-card-thumbnail" style="background-image: url(https://makerspace.experimenta.science/wp-content/uploads/2020/03/Elektrotechnik-scaled.jpg);"></div>
<?php elseif ($lab->name == "Holzwerkstatt") : ?>
<div class="device-card-thumbnail" style="background-image: url(https://makerspace.experimenta.science/wp-content/uploads/2020/03/Holzwerkstatt-scaled.jpg);"></div>
<?php elseif ($lab->name == "Medienwerkstatt") : ?>
<div class="device-card-thumbnail" style="background-image: url(https://makerspace.experimenta.science/wp-content/uploads/2020/03/Medienwerkstatt-scaled.jpg);"></div>
<?php elseif ($lab->name == "Textilwerkstatt") : ?>
<div class="device-card-thumbnail" style="background-image: url(https://makerspace.experimenta.science/wp-content/uploads/2020/03/Textilwerkstatt-scaled.jpg);"></div>
<?php else : ?>
<div class="device-card-thumbnail" style="background-image: url();"></div>
<?php endif; ?>
<div class="bg-white flex-fill p-2 overflow-hidden text-nowrap">
<h5 class="" title="<?php echo $lab->name; ?>">
<?php echo $lab->name; ?>
</h5>
</div>
<div class="p-0 pt-auto">
<div class="p-1 pl-2 pr-2 bg-white text-secondary">
<p>
<?php echo $lab->description; ?>
</p>
</div>
</div>
</div>
</a>
<?php endforeach; ?>
</div>
<div class="row">
<div class="col">
<a href="<?php echo get_term_link($lab_main, 'ms_devices_workshop'); ?>">
<button class="btn btn-primary w-100">Alle Geräte anzeigen</button>
</a>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php get_footer(); ?>