new page interviews
This commit is contained in:
@@ -1,28 +1,26 @@
|
||||
<?php
|
||||
|
||||
$args = array(
|
||||
'posts_per_page' => 10, // Количество постов для вывода
|
||||
'post_type' => 'post', // Тип постов для выборки (например, 'post', 'page', 'custom_post_type')
|
||||
'orderby' => 'date', // Сортировка по дате
|
||||
'order' => 'DESC', // Направление сортировки (DESC - по убыванию, ASC - по возрастанию)
|
||||
'category_name' => get_queried_object()->slug
|
||||
);
|
||||
$counter = 0;
|
||||
query_posts($args);
|
||||
|
||||
?>
|
||||
|
||||
<?php get_header() ?>
|
||||
<?php get_header(); ?>
|
||||
<div class="content-middle articles-wrapper">
|
||||
|
||||
<? get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title border-top">
|
||||
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
|
||||
<?php get_template_part('partials/rubrics-mobile'); ?>
|
||||
<div class="section-title desktop">
|
||||
<?php if (is_category()) : ?>
|
||||
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="articles-preview">
|
||||
<? if (have_posts()) : ?>
|
||||
<? while (have_posts()) : the_post(); ?>
|
||||
<?php
|
||||
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
|
||||
$counter = 0;
|
||||
$args = array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => 10,
|
||||
'paged' => $paged,
|
||||
'category__in' => get_queried_object_id()
|
||||
);
|
||||
$query = new WP_Query($args);
|
||||
?>
|
||||
|
||||
<? if ($query->have_posts()) : ?>
|
||||
<? while ($query->have_posts()) : $query->the_post(); ?>
|
||||
<? $counter++;
|
||||
$formatted_date = format_event_date(); ?>
|
||||
<a href="<? the_permalink(); ?>">
|
||||
@@ -57,6 +55,10 @@ query_posts($args);
|
||||
<a href="<?= home_url(); ?>" class="articles-preview__show-next mobile">На главную</a>
|
||||
</div>
|
||||
<? custom_pagination(); ?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<?php custom_pagination(); ?>
|
||||
</div>
|
||||
<?php
|
||||
get_footer() ?>
|
||||
<?php get_footer(); ?>
|
||||
Reference in New Issue
Block a user