modifying company members and handling company members phone gsm
This commit is contained in:
parent
1198242f44
commit
56984d12f2
|
|
@ -107,42 +107,57 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
<p><?php echo $company_description ?></p>
|
||||
|
||||
</section>
|
||||
<section class="artisans-post__section artisans-post__section--team ">
|
||||
<h2 class="artisans-post__section-title"><?php echo __("L'équipe", "metiers-patrimoine-theme") ?></h2>
|
||||
|
||||
<?php
|
||||
$company_description = get_field('company_description');
|
||||
$company_members = get_field('company_members');
|
||||
?>
|
||||
<?php foreach ($company_members as $member): ?>
|
||||
<div class="artisan-member">
|
||||
<img class="artisan-member__icon" src="<?php echo get_stylesheet_directory_uri() . '/resources/img/pictogrammes/Homegrade_repertoire-equipe.svg' ?>" alt="">
|
||||
<h3 class="artisan-member__name"><?php echo $member['first_name'] . ' ' . $member['last_name'] ?></h3>
|
||||
</div>
|
||||
<p class="artisan-member__description"><?php echo $member['description'] ?></p>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($company_members): ?>
|
||||
<section class="artisans-post__section artisans-post__section--team ">
|
||||
<h2 class="artisans-post__section-title"><?php echo __("L'équipe", "metiers-patrimoine-theme") ?></h2>
|
||||
|
||||
<?php
|
||||
$company_description = get_field('company_description');
|
||||
$company_members = get_field('company_members');
|
||||
?>
|
||||
<?php foreach ($company_members as $member): ?>
|
||||
<?php
|
||||
$member_gsm_number = $member['member_gsm_number'];
|
||||
$formatted_member_gsm_number = preg_replace('/^(\+\d{2})(\d{3})(\d{2})(\d{2})(\d{2})$/', '$1 $2 $3 $4 $5', $member_gsm_number);
|
||||
?>
|
||||
|
||||
<div class="artisan-member">
|
||||
<img class="artisan-member__icon" src="<?php echo get_stylesheet_directory_uri() . '/resources/img/pictogrammes/Homegrade_repertoire-equipe.svg' ?>" alt="">
|
||||
<div>
|
||||
<h3 class="artisan-member__name"><?php echo $member['first_name'] . ' ' . $member['last_name'] ?></h3>
|
||||
<?php if ($member_gsm_number): ?>
|
||||
<a class="artisan-member__phone" href="tel:<?php echo $member_gsm_number ?>"><?php echo $formatted_member_gsm_number ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<p class="artisan-member__description"><?php echo $member['description'] ?></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
</section>
|
||||
<section class="artisans-post__section artisans-post__section--chantiers">
|
||||
<h2 class="artisans-post__section-title"> <?php echo __(" Chantiers réalisés ", "metiers-patrimoine-theme") ?>
|
||||
</h2>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'chantiers',
|
||||
'posts_per_page' => -1,
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'artisan',
|
||||
'value' => $post->ID,
|
||||
'compare' => 'LIKE'
|
||||
)
|
||||
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'chantiers',
|
||||
'posts_per_page' => -1,
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'artisan',
|
||||
'value' => $post->ID,
|
||||
'compare' => 'LIKE'
|
||||
)
|
||||
);
|
||||
$chantiers = new WP_Query($args);
|
||||
?>
|
||||
<?php if ($chantiers->posts): ?>
|
||||
)
|
||||
);
|
||||
$chantiers = new WP_Query($args);
|
||||
?>
|
||||
<?php if ($chantiers->posts): ?>
|
||||
<section class="artisans-post__section artisans-post__section--chantiers">
|
||||
<h2 class="artisans-post__section-title"> <?php echo __(" Chantiers réalisés ", "metiers-patrimoine-theme") ?>
|
||||
</h2>
|
||||
|
||||
<?php foreach ($chantiers->posts as $chantier): ?>
|
||||
<?php
|
||||
$chantier_description = get_field('description', $chantier->ID);
|
||||
|
|
@ -159,68 +174,68 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
|||
</div>
|
||||
<p class="chantier__description"><?php echo $chantier_description ?></p>
|
||||
|
||||
<div class="chantier__photo-grid">
|
||||
<?php
|
||||
foreach ($pictures as $key => $picture) {
|
||||
}
|
||||
?>
|
||||
|
||||
<?php foreach ($pictures as $picture): ?>
|
||||
<img src="<?php echo $picture['sizes']['large'] ?>" />
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php
|
||||
// Rendre Un bloc acf/lightbox-gallery avec les photos du chantier
|
||||
$block_content = '<!-- wp:acf/lightbox-gallery {"data":{"gallery":' . json_encode($pictures) . '}} /-->';
|
||||
echo do_blocks($block_content);
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="previous-next-posts previous-next-artisan">
|
||||
|
||||
<?php
|
||||
$prevPost = get_previous_post();
|
||||
$nextPost = get_next_post();
|
||||
?>
|
||||
<?php if ($nextPost) : ?>
|
||||
<?php $nextPostcover = get_the_post_thumbnail_url($nextPost->ID, 'full'); ?>
|
||||
<a class="previous-next-posts__next previous-next-artisans__next" href="<?php echo get_the_permalink($nextPost->ID) ?>">
|
||||
|
||||
<div class="previous-next-posts__link-content previous-next-artisan__link-content">
|
||||
<p class="link-subtitle"><?php echo __("Entreprise suivante ", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||
<p class="link-title"><?php echo $nextPost->post_title ?></p>
|
||||
</div>
|
||||
<?php if ($nextPostcover): ?>
|
||||
<img class="previous-next-posts__post-thumbnail" src="<?php echo $nextPostcover ?>" alt="">
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if ($prevPost) : ?>
|
||||
<?php $prevPostcover = get_the_post_thumbnail_url($prevPost->ID, 'full'); ?>
|
||||
<a class="previous-next-posts__previous previous-next-artisan__previous" href="<?php echo get_the_permalink($prevPost->ID) ?>">
|
||||
<?php if ($prevPostcover): ?>
|
||||
<img class="previous-next-posts__post-thumbnail" src="<?php echo $prevPostcover ?>" alt="">
|
||||
<?php endif; ?>
|
||||
<div class="previous-next-posts__link-content previous-next-artisan__link-content">
|
||||
<p class="link-subtitle"><?php echo __("Entreprise précédente ", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||
<p class="link-title"><?php echo $prevPost->post_title ?></p>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div>
|
||||
<?php
|
||||
$prevPost = get_previous_post();
|
||||
$nextPost = get_next_post();
|
||||
// echo $prev_post->post_title;
|
||||
// write_log($nextPost);
|
||||
|
||||
echo '<pre>';
|
||||
print_r($prevPost);
|
||||
echo '</pre>';
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php if ($nextPost) : ?>
|
||||
<a class="previous-next-questions__next" href="<?php echo get_the_permalink($nextPost->ID) ?>">
|
||||
<div class="previous-next-questions__link-content">
|
||||
<p class="question_type"><?php echo __("Entreprise suivante ", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||
<p class="question_title"><?php echo $nextPost->post_title ?></p>
|
||||
</div>
|
||||
<img class="thematique_icon" src="<?php echo $thematique_icon['url'] ?>" alt="">
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($previousPost) : ?>
|
||||
<a class="previous-next-questions__previous" href="<?php echo get_the_permalink($previousPost->ID) ?>">
|
||||
<img class="thematique_icon" src="<?php echo $thematique_icon['url'] ?>" alt="">
|
||||
<div class="previous-next-questions__link-content">
|
||||
<p class="question_type"><?php echo __("Entreprise précédente ", "homegrade-theme__texte-fonctionnel") ?></p>
|
||||
<p class="question_title"><?php echo $previousPost->post_title ?></p>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
|
||||
|
||||
get_template_part('template-components/conseil-patrimoine-redirector', null, array());
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user