-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtpl-announcements.php
More file actions
55 lines (44 loc) · 1.23 KB
/
tpl-announcements.php
File metadata and controls
55 lines (44 loc) · 1.23 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
53
54
55
<?php
/**
* Template Name: Announcements
*/
?>
<?php get_header(); ?>
<section class="section">
<div class="container">
<h1 class="title">
<?php the_title(); ?>
</h1>
<?php
$paged = get_query_var('paged');
$query = new WP_Query(array(
'post_type' => 'project',
'meta_query' => array(
array(
'key' => 'date',
'value' => (int)date('Ymd'),
'compare' => '>'
)
),
'paged' => ($paged) ? $paged : 1
));
?>
<?php if ($query->have_posts()) { ?>
<div class="clearfix grid">
<?php while ($query->have_posts()) {
$query->the_post(); ?>
<?php post(true); ?>
<?php } ?>
<?php pagination($query); ?>
</div>
<?php } else { ?>
<div class="nothing-on-page">
<?php if ($text = pllGetOption('no_announcements')) { ?>
<?php echo $text; ?>
<?php } ?>
</div>
<?php } ?>
<?php wp_reset_postdata(); ?>
</div>
</section>
<?php get_footer();