-
Notifications
You must be signed in to change notification settings - Fork 0
/
vm_pollsListPage.php
44 lines (31 loc) · 1012 Bytes
/
vm_pollsListPage.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
<?php
/* Template Name: vm_pollListPage */
global $wpdb;
$table_name = "{$wpdb->prefix}posts";
$pollList = $wpdb->get_results("SELECT post_title, post_name
FROM `$table_name`
WHERE post_status = 'publish'
AND post_type = 'torro_form'
");
get_header();
the_post();
?>
<div class='container'>
<div class='row'>
<div class='col-lg-8'>
<h1 class='mt-4'><?php single_post_title(); ?></h1>
<div class='mt-4' style="font-size: 1.4rem;">
<p class="font-weight-bold mb-2">Seznam probíhajících anket:</p>
<?php
if (!empty($pollList)) {
foreach ($pollList as $poll) {
echo '<p class="ml-2"><a href="/ankety/' . $poll->post_name . '">' . $poll->post_title . '</a></p>';
}
} else echo "<p>Litujeme, ale momentálně žádná neprobíha</p>";
?>
</div>
</div>
</div>
</div>
<?php
get_footer();