<?php
/*
Template Name: Шаблон страницы партнёров
*/

$partners = new WP_Query([
    'post_type' => 'partners',
    'posts_per_page' => 10,
    'orderby' => 'date',
    'order' => 'DESC'
]);
?>

<?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"><?= the_title() ?></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-item__image-container">
                        <?= show_post_image(); ?>
                    </div>
                    <div class="partner-item__text-container">
                        <p class="subtitle-16"><?= get_the_title(); ?></p>
                    </div>
                </a>
        <?php
            endwhile;
        endif;
        ?>
    </div>
    <? custom_pagination($partners); ?>
</div>

<?php get_footer(); ?>