-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-latest-updates.php
46 lines (46 loc) · 1.22 KB
/
page-latest-updates.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
<?php
get_header();
?>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = [
'post_type' => 'post',
'posts_per_page' => 10,
'paged' => $paged,
'tax_query' => [
[
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => ['post-format-aside', 'post-format-status']
]
]
];
$aside_query = new WP_Query($args);
$count = 0;
if ($aside_query->have_posts()) :
?>
<div class="blog-welcome">
<h1 class="alternate">Latest Updates</h1>
<p>Breaking weather updates for the Charleston, SC metro area.</p>
</div>
<div class="latest-updates-archive">
<?php while ($aside_query->have_posts()) :
$aside_query->the_post(); ?>
<?php if (is_new_day()) : ?><h2 class="date-header"><?php the_date(); ?></h2><?php endif; ?>
<?php get_template_part('template-parts/part', 'aside'); ?>
<?php
endwhile;
?>
<?php
the_posts_navigation(
array(
'prev_text' => "« Older posts",
'next_text' => "Newer posts »"
)
);
wp_reset_query();
?>
</div>
<?php
endif;
get_footer();