92 lines
2.9 KiB
PHP
92 lines
2.9 KiB
PHP
<?php
|
|
$statuses = get_field_object('comity', get_the_ID());
|
|
$comities_field_object = get_field_object('field_6836da6d03ff6');
|
|
$comities = $comities_field_object ? $comities_field_object['choices'] : [];
|
|
|
|
$field_auteurs = get_field_object('auteurs', 'group_auteurs');
|
|
$placeholder_thumbnail_counter = 0;
|
|
|
|
|
|
|
|
$authors = get_posts(array(
|
|
'post_type' => 'auteurs',
|
|
'posts_per_page' => -1,
|
|
'orderby' => 'title',
|
|
'order' => 'ASC',
|
|
));
|
|
?>
|
|
|
|
<section class="team-authors content-section">
|
|
<h2 class="title-small">Équipe dynamiques</h2>
|
|
<h3 class="subtitle-big">À la croisée des plumes et des luttes</h3>
|
|
|
|
|
|
<div class="container">
|
|
<?php foreach ($comities as $comity_value => $comity_label) : ?>
|
|
<?php $comities_related_authors = get_posts(array(
|
|
'post_type' => 'auteurs',
|
|
'posts_per_page' => -1,
|
|
'meta_key' => 'last_name',
|
|
'orderby' => 'meta_value',
|
|
'order' => 'ASC',
|
|
'meta_query' => array(
|
|
array(
|
|
'key' => 'comity',
|
|
'value' => $comity_value,
|
|
'compare' => 'LIKE',
|
|
),
|
|
),
|
|
));
|
|
|
|
if (count($comities_related_authors) < 1) continue;
|
|
|
|
?>
|
|
<div class="comity-type">
|
|
<h3 class="comity-type__title"><?php echo $comity_label; ?></h3>
|
|
|
|
|
|
<ul class="comity-type__list">
|
|
<?php foreach ($comities_related_authors as $author) : ?>
|
|
<?php
|
|
|
|
$author_thumbnail = get_field('profile_thumbnail', $author->ID);
|
|
$author_description = get_field('description', $author->ID);
|
|
$author_email = get_field('email', $author->ID);
|
|
|
|
?>
|
|
<li class="comity-type__item author-card ">
|
|
<div class="author-card__profile-picture">
|
|
<?php if ($author_thumbnail) : ?>
|
|
<img src="<?php echo $author_thumbnail['url']; ?>" alt="<?php echo $author_thumbnail['alt']; ?>">
|
|
<?php else : ?>
|
|
<div class="author-card__profile-picture-placeholder lol author-card__profile-picture-placeholder--<?php echo $placeholder_thumbnail_counter % 3 + 1; ?>n">
|
|
<!-- <img class="" src="<?php echo get_template_directory_uri(); ?>/assets/images/placeholder-author.png" alt="Placeholder author"> -->
|
|
</div>
|
|
<?php $placeholder_thumbnail_counter++; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<h4 class="author-card__name"><?php echo $author->post_title; ?></h4>
|
|
|
|
<p class="author-card__bio"><?php echo $author_description; ?></p>
|
|
<?php if ($author_email) : ?>
|
|
<a href="mailto:<?php echo $author_email; ?>" class="author-card__email cta cta--classic cta--rounded cta--has-icon cta--mailing">
|
|
<div class="cta__icon">
|
|
<?php $mail_svg_path = get_template_directory() . '/resources/img/icons/carhop-mail.svg';
|
|
if (file_exists($mail_svg_path)) {
|
|
echo file_get_contents($mail_svg_path);
|
|
} ?>
|
|
</div>
|
|
Envoyer un email
|
|
</a>
|
|
<?php endif; ?>
|
|
</li>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|