corect archiv
This commit is contained in:
@@ -26,11 +26,15 @@ if( $posts ):
|
|||||||
<?if (LANG_VERSION == 'ru'):?>
|
<?if (LANG_VERSION == 'ru'):?>
|
||||||
<div class="right_archive_link"><a href="<?php the_permalink(); ?>"><?=the_title();?></a></div>
|
<div class="right_archive_link"><a href="<?php the_permalink(); ?>"><?=the_title();?></a></div>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
<br>
|
||||||
|
<center class="left_center_block">
|
||||||
|
<a href="https://vetandlife.ru/category/arkhiv/" class="left_button" target="_blank">Архив номеров</a>
|
||||||
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php endforeach;
|
<?php endforeach;
|
||||||
|
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();?>
|
||||||
|
|
||||||
endif;
|
<?php endif;
|
||||||
|
|||||||
@@ -33,6 +33,17 @@ get_header();?>
|
|||||||
$page = get_query_var('paged');
|
$page = get_query_var('paged');
|
||||||
$curryear = date('Y');
|
$curryear = date('Y');
|
||||||
|
|
||||||
|
$year_params = [
|
||||||
|
|
||||||
|
'posts_per_page' => -1 ,
|
||||||
|
'category' => 3, // 19 - архив газеты,
|
||||||
|
'orderby' => 'date',
|
||||||
|
'order' => 'DESC',
|
||||||
|
'post_type' => 'post',
|
||||||
|
'suppress_filters' => true
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
if ($page == 0) {
|
if ($page == 0) {
|
||||||
$page = 1;
|
$page = 1;
|
||||||
$numbers_year = $curryear;
|
$numbers_year = $curryear;
|
||||||
@@ -42,15 +53,21 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$posts = get_posts( array(
|
$curr_params = $year_params;
|
||||||
'posts_per_page' => -1 ,
|
$curr_params['year'] = $numbers_year;
|
||||||
'category' => 3, // 19 - архив газеты,
|
|
||||||
'year' => $numbers_year,
|
$posts = get_posts($curr_params);
|
||||||
'orderby' => 'date',
|
|
||||||
'order' => 'DESC',
|
if (count($posts) == 0){
|
||||||
'post_type' => 'post',
|
|
||||||
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
$numbers_year = $numbers_year - 1;
|
||||||
) );
|
|
||||||
|
$curr_params = $year_params;
|
||||||
|
$curr_params['year'] = $numbers_year;
|
||||||
|
|
||||||
|
$posts = get_posts($curr_params);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -86,6 +103,13 @@ $posts = get_posts( array(
|
|||||||
|
|
||||||
</div> <!--//end minicard block -->
|
</div> <!--//end minicard block -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?//get_template_part( '/blocks/paginator');?>
|
||||||
|
|
||||||
|
<?endif?>
|
||||||
|
|
||||||
|
|
||||||
<div class="pagination-wrapper">
|
<div class="pagination-wrapper">
|
||||||
<nav class="navigation pagination" role="navigation" aria-label="Записи">
|
<nav class="navigation pagination" role="navigation" aria-label="Записи">
|
||||||
<div class="nav-links">
|
<div class="nav-links">
|
||||||
@@ -103,17 +127,11 @@ $posts = get_posts( array(
|
|||||||
<?endfor?>
|
<?endfor?>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?//get_template_part( '/blocks/paginator');?>
|
|
||||||
|
|
||||||
<?endif?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -120,9 +120,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- end main -->
|
</div><!-- end main -->
|
||||||
|
|
||||||
|
|
||||||
<footer id="footer">
|
|
||||||
|
|
||||||
<?if (LANG_VERSION == 'ru'):?>
|
<?if (LANG_VERSION == 'ru'):?>
|
||||||
|
|
||||||
<div class="mobile-info">
|
<div class="mobile-info">
|
||||||
@@ -162,6 +159,7 @@
|
|||||||
<?php include get_template_directory().'/blocks/mobile-subscript.php';?>
|
<?php include get_template_directory().'/blocks/mobile-subscript.php';?>
|
||||||
|
|
||||||
|
|
||||||
|
<footer id="footer">
|
||||||
|
|
||||||
<div id="footer_menu">
|
<div id="footer_menu">
|
||||||
<?php wp_footer(); ?>
|
<?php wp_footer(); ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user