<?php
$partners = new WP_Query([
    'category_name' => 'partners',
    'post_type' => 'post',
    'posts_per_page' => 10,
    'orderby' => 'date',
    'order' => 'ASC'
]);
?>

<?php get_header(); ?>
<div class="content-middle articles-wrapper">
    <?php get_template_part('partials/rubrics-mobile'); ?>
    <div class="section-title">
        <h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
    </div>
    <div class="articles-preview">
        <?
        if ($partners->have_posts()) :
            while ($partners->have_posts()) :
                $partners->the_post();
        ?>
                <a href="<?= get_permalink(); ?>" class="partner-item">
                    <div class="partner-logo">
                    <?if ( has_post_thumbnail() ) {
                        the_post_thumbnail( 'thumbnail' ); // Это выведет самую маленькую превьюшку
                    }?>
                    </div>
                    <div class="partner-item__text-container">
                        <p class="subtitle-16"><?= get_the_title(); ?></p>
                    </div>
                </a>
        <?php
            endwhile;
        endif;
        ?>
    </div>
    <? custom_pagination($partners); ?>

    <?php get_template_part('partials/related-posts', '', array('posts_per_page' => 8) ); ?>

</div>

<?php
get_footer(); ?>