-
Notifications
You must be signed in to change notification settings - Fork 1
/
archive.php
45 lines (43 loc) · 1.12 KB
/
archive.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
<?php
get_header();
?>
<main id="main-content" role="main">
<div class="container">
<div class="row">
<div class="col-12 text-center archive">
<h1><?php echo single_cat_title() ?></h1>
</div>
<aside class="col-12 col-lg-3 archive menu">
<?php if(single_cat_title('', false) == 'News'): ?>
<h2>Filter news by year</h2>
<nav aria-label="Submenu">
<?php
wp_custom_archive();
?>
</nav>
<?php endif; ?>
</aside>
<div class="col-12">
<?php
if (have_posts()) :
while (have_posts()) :
the_post();
?>
<ul class="list-unstyled">
<?php
?><li><?php
$date = new DateTime($post->post_date);
echo '<a href="'.get_permalink($post).'">';
echo $date->format('Y-m-d').' '.$post->post_title;
echo '</a>';
echo '<hr>';
?></li><?php
endwhile;
endif;
?>
</div>
</div>
</div>
</main>
<?php
get_footer();