correct tag code

This commit is contained in:
2025-06-20 12:11:30 +03:00
parent 349dfe7bc6
commit dfdc594c85
3 changed files with 8 additions and 3 deletions

View File

@@ -222,6 +222,7 @@ function custom_wpseo_breadcrumb_output($output)
function custom_pagination($query = null, $class = "pagination")
{
global $wp_query;
$query = $query ?: $wp_query;
$current_page = max(1, get_query_var('paged'));
$total_pages = $query->max_num_pages;

View File

@@ -47,8 +47,11 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
</head>
<? if ( !is_tag() ):?>
<body <?php body_class(); ?>>
<?else:?>
<body>
<?endif?>
<?php wp_body_open(); ?>
<div id="app">
<?if (function_exists('krutilka_placement')):?>

View File

@@ -13,7 +13,7 @@
'post_type' => 'post',
'posts_per_page' => 13,
'paged' => $paged,
'tag_id' => get_queried_object_id() // Используем tag_id вместо category__in
'tag_id' => get_queried_object_id(), // Используем tag_id вместо category__in
);
$query = new WP_Query($args);
@@ -29,6 +29,7 @@
wp_reset_postdata();
?>
</div>
<?php custom_pagination(); ?>
<?php custom_pagination( $query );
wp_reset_postdata();?>
</div>
<?php get_footer(); ?>