-
Notifications
You must be signed in to change notification settings - Fork 0
/
taxonomy-glossary-category.php
54 lines (38 loc) · 1.15 KB
/
taxonomy-glossary-category.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
<?php
get_header();
?>
<div class="main-area-full"></div>
<main id="main" class="main-area">
<div class="entry-content">
<header class="page-header">
<!-- pre>taxonomy-glossary-category.php</pre -->
<h1>Glossary category:
<?php
$terms = get_the_terms($post->ID, 'glossary-category');
foreach ($terms as $term){
echo '<span>' . $term->name . '</span>';
}
?>
</h1>
</header>
<?php
// display a list with all categories = custom taxonomy 'glossary-category'
$link = get_site_url();
$terms = get_terms([
'taxonomy' => 'glossary-category',
'hide_empty' => false,
]);
echo '<ul class="glossary-terms-menu">';
echo '<li class="home-link glossary-term-button"><a href="' . $link . '/glossary">all categories</a></li>';
foreach ($terms as $term){
echo '<li class="glossary-term-button"><a href="' . get_term_link($term) . '">' . $term->name . '</a></li>';
}
echo '</ul>';
// table with all lemmas
get_template_part( 'template-parts/content', 'glossary-table' );
?>
</div><!-- .entry-content -->
</main>
<div class="main-area-full"></div>
<?php
get_footer();