2026-10-06 20:43:46 +00:00

55 lines
2.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// Секция преподавателей (блок на страницах) — карточка общая с /our-teachers/
if (! defined('ABSPATH')) {
exit;
}
$teacher_ids = $args['teacher_ids'] ?? array();
$description = isset($args['description']) ? $args['description'] : 'Каждый педагог имеет опыт работы с дошкольниками от 5 лет. Все — действующие учителя начальных классов с высшим образованием.';
$hide_label = ! empty($args['hide_label']);
$title = isset($args['title']) ? $args['title'] : 'Наши преподаватели — практикующие педагоги';
$query_args = array(
'post_type' => 'teacher',
'posts_per_page' => -1,
'post_status' => 'publish',
);
if (! empty($teacher_ids)) {
$query_args['post__in'] = $teacher_ids;
$query_args['orderby'] = 'post__in';
} else {
$query_args['orderby'] = 'date';
$query_args['order'] = 'DESC';
}
$teachers_query = new WP_Query($query_args);
?>
<section class="bento teachers-cards" id="teachers" aria-label="Преподаватели">
<div class="bento__full section-header--centered">
<?php if (! $hide_label) : ?>
<span class="bento-label">Преподаватели</span>
<?php endif; ?>
<h2 class="bento-h2"><?php echo esc_html($title); ?></h2>
<p class="bento-p"><?php echo esc_html($description); ?></p>
</div>
<div class="bento__full">
<div class="teachers-cards__grid">
<?php if ($teachers_query->have_posts()) : ?>
<?php while ($teachers_query->have_posts()) : $teachers_query->the_post(); ?>
<?php get_template_part('template-parts/teachers/card', null, array( 'id' => get_the_ID() )); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</div>
</div>
<div class="teachers-cards__footer">
<a class="teachers-cards__all-link" href="/our-teachers/">
Все преподаватели
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14m-7-7 7 7-7 7"/></svg>
</a>
</div>
</section>