-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtopics.php
More file actions
52 lines (45 loc) · 1.15 KB
/
topics.php
File metadata and controls
52 lines (45 loc) · 1.15 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
<?php
/*
Template Name: Topics
We provide a list of topics in alphabetical order.
*/
get_header();
// Get all topics
$terms = get_terms(array(
'taxonomy' => 'topic',
'hide_empty' => true,
));
// Create a table, thumbnail
?>
<main id="main" class="site-main" role="main">
<div class="row">
<div class="col-lg-8 col-md-7 middle-panel-rise">
<h2 class="text-center"><?php echo get_the_title()?></h2><br>
<div>
<?php the_content();?>
</div>
<table class="table table-bordered table-hover topic-table">
<thead>
<tr>
<th>Topic</th>
<th>Count</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<?php foreach ($terms as $term){
$link = FEEDER_LINK . "?" . SHOW_QUESTION . "=0&" . TOPIC . "=" . $term->slug;
$row_string = "<tr><td id=\"" . $term->slug . "\"><a href=\"" . $link . "\">" . $term->name . "</a></td>"
. "<td>" . $term->count . "</td>"
. "<td style=\"text-align:left;\">" . $term->description . "</td></tr>";
echo $row_string;
}?>
</tbody>
</table>
</div>
<div class="col-lg-4 col-md-5">
<?php get_sidebar('footer');?>
</div>
</div>
</main>
<?php get_footer(); ?>