Доброго времени суток.
Есть такой код
<?php
$currentTerm = get_queried_object();
$children = get_term_children($currentTerm -> term_id, 'category');
if($children): ?>
<?php
$args = array(
'taxonomy' => 'category',
'hide_empty' => 0,
'depth' => 1,
'parent' => get_queried_object()->term_id
);
$terms = get_terms( $args );
$count = 1;
?>
<?php foreach ($terms as $term): ?>
<a href="<?php echo get_post_type_archive_link('project'); echo $term->slug ?>"><?php echo $term->name ?></a>
<?php endforeach; ?>
<?php else : ?>
<?php if ( have_posts() ) : while (have_posts()) : the_post();?>
<a class="swiper-slide" href="<?php echo get_permalink(); ?>">
<div class="swiper-slide__label">
<?php
$category = get_the_category();
echo $category[0]->cat_name;
?>
</div><img src="<?php the_field('small_img', get_the_ID()) ?>">
<div class="slider-pre">
<div class="slider-pre__title"><?php the_title(); ?></div>
<div class="slider-pre__anons"><?php the_field('anons_date', get_the_ID()) ?></div>
</div>
</a>
<?php endwhile;?>
<?php endif;?>
<?php endif;?>
подрубрики выводит, а вот посты почему то нет, в чем ошибка?