FEATURE Refining the component aspect
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3af7d828c9
commit
bb842dedc4
|
|
@ -4,6 +4,9 @@ $comities_field_object = get_field_object('field_6836da6d03ff6');
|
||||||
$comities = $comities_field_object ? $comities_field_object['choices'] : [];
|
$comities = $comities_field_object ? $comities_field_object['choices'] : [];
|
||||||
|
|
||||||
$field_auteurs = get_field_object('auteurs', 'group_auteurs');
|
$field_auteurs = get_field_object('auteurs', 'group_auteurs');
|
||||||
|
$placeholder_thumbnail_counter = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$authors = get_posts(array(
|
$authors = get_posts(array(
|
||||||
'post_type' => 'auteurs',
|
'post_type' => 'auteurs',
|
||||||
|
|
@ -20,40 +23,49 @@ $authors = get_posts(array(
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<?php foreach ($comities as $comity_value => $comity_label) : ?>
|
<?php foreach ($comities as $comity_value => $comity_label) : ?>
|
||||||
|
<?php $comities_related_authors = get_posts(array(
|
||||||
|
'post_type' => 'auteurs',
|
||||||
|
'posts_per_page' => -1,
|
||||||
|
'orderby' => 'title',
|
||||||
|
'order' => 'ASC',
|
||||||
|
'meta_query' => array(
|
||||||
|
array(
|
||||||
|
'key' => 'comity',
|
||||||
|
'value' => $comity_value,
|
||||||
|
'compare' => 'LIKE',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
|
if (count($comities_related_authors) < 1) continue;
|
||||||
|
|
||||||
|
?>
|
||||||
<div class="comity-type">
|
<div class="comity-type">
|
||||||
<h3 class="comity-type__title"><?php echo $comity_label; ?></h3>
|
<h3 class="comity-type__title"><?php echo $comity_label; ?></h3>
|
||||||
|
|
||||||
<?php $comities_related_authors = get_posts(array(
|
|
||||||
'post_type' => 'auteurs',
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'orderby' => 'title',
|
|
||||||
'order' => 'ASC',
|
|
||||||
'meta_query' => array(
|
|
||||||
array(
|
|
||||||
'key' => 'comity',
|
|
||||||
'value' => $comity_value,
|
|
||||||
'compare' => '=',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="comity-type__list">
|
<ul class="comity-type__list">
|
||||||
<?php foreach ($comities_related_authors as $author) : ?>
|
<?php foreach ($comities_related_authors as $author) : ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$author_thumbnail = get_field('profile_thumbnail', $author->ID);
|
$author_thumbnail = get_field('profile_thumbnail', $author->ID);
|
||||||
$author_description = get_field('description', $author->ID);
|
$author_description = get_field('description', $author->ID);
|
||||||
$author_email = get_field('email', $author->ID);
|
$author_email = get_field('email', $author->ID);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li class="comity-type__item author-card">
|
<li class="comity-type__item author-card ">
|
||||||
<div class="author-card__thumbnail">
|
<div class="author-card__profile-picture">
|
||||||
<?php if ($author_thumbnail) : ?>
|
<?php if ($author_thumbnail) : ?>
|
||||||
<img src="<?php echo $author_thumbnail['url']; ?>" alt="<?php echo $author_thumbnail['alt']; ?>">
|
<img src="<?php echo $author_thumbnail['url']; ?>" alt="<?php echo $author_thumbnail['alt']; ?>">
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/placeholder-author.png" alt="Placeholder author">
|
<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; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="author-card__name"><?php echo $author->post_title; ?></h4>
|
<h4 class="author-card__name"><?php echo $author->post_title; ?></h4>
|
||||||
|
|
||||||
<p class="author-card__bio"><?php echo $author_description; ?></p>
|
<p class="author-card__bio"><?php echo $author_description; ?></p>
|
||||||
<?php if ($author_email) : ?>
|
<?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">
|
<a href="mailto:<?php echo $author_email; ?>" class="author-card__email cta cta--classic cta--rounded cta--has-icon cta--mailing">
|
||||||
|
|
@ -67,6 +79,8 @@ $authors = get_posts(array(
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user