70 lines
2.4 KiB
PHP
70 lines
2.4 KiB
PHP
<?php
|
|
|
|
$teamMembers = get_posts(array(
|
|
'post_type' => 'equipe',
|
|
'posts_per_page' => -1,
|
|
));
|
|
|
|
|
|
$placeholder_thumbnail_counter = 0;
|
|
$personnalized_order = get_field('personnalized_order');
|
|
$members_manually_sorted = get_field('members_manually_sorted');
|
|
|
|
|
|
if ($personnalized_order) {
|
|
$teamMembers = $members_manually_sorted;
|
|
}
|
|
|
|
?>
|
|
|
|
<section class="team-authors content-section" <?php echo get_block_wrapper_attributes(); ?>>
|
|
<div class="container">
|
|
<ul class="comity-type__list">
|
|
<?php foreach ($teamMembers as $member) : ?>
|
|
<?php
|
|
|
|
$member_thumbnail = get_field('profile_thumbnail', $member->ID);
|
|
$member_description = get_field('description', $member->ID);
|
|
$member_email = get_field('email', $member->ID);
|
|
|
|
$is_director = $member->ID === 476 ? true : false;
|
|
|
|
?>
|
|
<li class="comity-type__item author-card <?php echo $is_director ? 'author-card--director' : ''; ?>">
|
|
<div class="author-card__profile-picture">
|
|
<?php if ($member_thumbnail) : ?>
|
|
<a href="<?php echo get_the_permalink($author->ID); ?>">
|
|
<img src="<?php echo $member_thumbnail['url']; ?>" alt="<?php echo $member_thumbnail['alt']; ?>">
|
|
</a>
|
|
<?php else : ?>
|
|
<a href="<?php echo get_the_permalink($member->ID); ?>">
|
|
<div class="author-card__profile-picture-placeholder 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>
|
|
</a>
|
|
<?php $placeholder_thumbnail_counter++; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<h4 class="author-card__name">
|
|
<a href="<?php echo get_the_permalink($member->ID); ?>"> <?php echo $member->post_title; ?></a>
|
|
</h4>
|
|
|
|
<p class="author-card__bio"><?php echo $member_description; ?></p>
|
|
<?php if ($member_email) : ?>
|
|
<a href="mailto:<?php echo $member_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>
|
|
</section>
|