-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-stampa.php
35 lines (26 loc) · 1.11 KB
/
page-stampa.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
<?php get_header(); ?>
<section class="container">
<?php
$year = get_query_var('y', date("Y"));
$query = new WP_Query(array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'year' => $year,
'tag' => 'stampa'
)); ?>
<h1 class="text-4xl w-full font-bold text-center uppercase">Stampa <?php echo $year; ?></h1>
<div class="grid grid-cols-6 md:grid-cols-12 gap-y-4 grid-flow-row mt-8 text-center">
<?php for($i = date("Y"); $i >= 2022; $i--): ?>
<a href="<?php echo get_permalink() . '?y=' . $i;?>" class="box-border"><span class="text-lg <?php echo $i == $year ? 'border-b-4 border-red-800 font-bold text-xl' : ''; ?>"><?php echo $i; ?></span></a>
<?php endfor; ?>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 lg:grid-rows-2 md:gap-x-8 xl:gap-x-32 gap-y-8 text-center mt-16">
<?php if($query->have_posts()):
$query->the_post();
the_content();
endif; ?>
</div>
</section>
<?php
get_footer();