Initial commit
This commit is contained in:
32
date.php
Normal file
32
date.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php get_header(); ?>
|
||||
<div class="content-middle articles-wrapper">
|
||||
<div class="section-title desktop">
|
||||
<h1 class="section-title__title">Материалы <?= get_the_date();?></h1>
|
||||
</div>
|
||||
<div class="articles-preview">
|
||||
<?php
|
||||
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
|
||||
$year = get_query_var('year');
|
||||
$month = str_pad(get_query_var('monthnum'), 2, '0', STR_PAD_LEFT);
|
||||
$day = str_pad(get_query_var('day'), 2, '0', STR_PAD_LEFT);
|
||||
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 10,
|
||||
'paged' => $paged,
|
||||
'post_status' => array('publish', 'future'),
|
||||
'date_query' => array(
|
||||
array(
|
||||
'year' => $year,
|
||||
'month' => $month,
|
||||
'day' => $day,
|
||||
),
|
||||
),
|
||||
);
|
||||
$query = new WP_Query($args);
|
||||
?>
|
||||
<?php get_template_part('partials/post-list', null, ['query' => $query]); ?>
|
||||
</div>
|
||||
<?php custom_pagination($query); ?>
|
||||
</div>
|
||||
<?php get_footer(); ?>
|
||||
Reference in New Issue
Block a user