developping the single
This commit is contained in:
parent
aefa66cb37
commit
d0ddf2c545
|
|
@ -6,61 +6,175 @@ get_header();
|
|||
get_header();
|
||||
$pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||
?>
|
||||
|
||||
<nav class=" breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
|
||||
<?php
|
||||
$currentPage = get_post(get_queried_object_id());
|
||||
$networkHomeUrl = network_home_url();
|
||||
$pages = get_pages(array(
|
||||
'meta_key' => '_wp_page_template',
|
||||
'meta_value' => 'template-repertoire-des-metiers.php'
|
||||
));
|
||||
|
||||
//get page id with template Template Name: Repertoire des métiers
|
||||
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||
|
||||
|
||||
$frontPageUrl = get_home_url();
|
||||
$frontPageTitle = get_the_title(get_option('page_on_front'));
|
||||
|
||||
$searchPageId = 43;
|
||||
$searchPageTitle = get_the_title($searchPageId);
|
||||
$searchPageUrl = get_post_permalink($searchPageId);
|
||||
$pageIcon = get_field('page_icon', $searchPageId) ?? null;
|
||||
|
||||
|
||||
?>
|
||||
<ol>
|
||||
<li>
|
||||
<a href="<?php echo $networkHomeUrl ?>" title="<?php echo __("Accueil", "homegrade-theme__texte-fonctionnel") ?>">
|
||||
<img src="<?php echo get_template_directory_uri() . "/resources/img/pictogrammes/icon_house_dark.svg" ?>" alt="">
|
||||
</a>
|
||||
</li>
|
||||
<nav class=" breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
|
||||
<?php
|
||||
$currentPage = get_post(get_queried_object_id());
|
||||
$networkHomeUrl = network_home_url();
|
||||
$pages = get_pages(array(
|
||||
'meta_key' => '_wp_page_template',
|
||||
'meta_value' => 'template-repertoire-des-metiers.php'
|
||||
));
|
||||
|
||||
//get page id with template Template Name: Repertoire des métiers
|
||||
|
||||
|
||||
<li><a href="<?php echo $frontPageUrl ?>"><?php echo $frontPageTitle ?></a></li>
|
||||
$frontPageUrl = get_home_url();
|
||||
$frontPageTitle = get_the_title(get_option('page_on_front'));
|
||||
|
||||
<li><a href="<?php echo $searchPageUrl ?>"><?php echo $searchPageTitle ?></a></li>
|
||||
$searchPageId = 43;
|
||||
$searchPageTitle = get_the_title($searchPageId);
|
||||
$searchPageUrl = get_post_permalink($searchPageId);
|
||||
$pageIcon = get_field('page_icon', $searchPageId) ?? null;
|
||||
|
||||
<?php if ($currentPage) : ?>
|
||||
<li><a href="<?php echo get_post_permalink($currentPage->ID) ?>" aria-current="location" aria-disabled="true"><?php echo $currentPage->post_title ?></a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
<div class="homegrade-page-container metiers-patrimoine-page-container--single-artisans">
|
||||
?>
|
||||
<ol>
|
||||
<li>
|
||||
<a href="<?php echo $networkHomeUrl ?>" title="<?php echo __("Accueil", "homegrade-theme__texte-fonctionnel") ?>">
|
||||
<img src="<?php echo get_template_directory_uri() . "/resources/img/pictogrammes/icon_house_dark.svg" ?>" alt="">
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php /* --------
|
||||
|
||||
<li><a href="<?php echo $frontPageUrl ?>"><?php echo $frontPageTitle ?></a></li>
|
||||
|
||||
<li><a href="<?php echo $searchPageUrl ?>"><?php echo $searchPageTitle ?></a></li>
|
||||
|
||||
<?php if ($currentPage) : ?>
|
||||
<li><a href="<?php echo get_post_permalink($currentPage->ID) ?>" aria-current="location" aria-disabled="true"><?php echo $currentPage->post_title ?></a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
<div class="homegrade-page-container metiers-patrimoine-page-container--single-artisans">
|
||||
|
||||
<?php /* --------
|
||||
HEADING BOX
|
||||
---------------*/ ?>
|
||||
<?php
|
||||
get_template_part("template-components/heading-box", null, array(
|
||||
"pageIcon" => $pageIcon,
|
||||
"title" => $currentPage->post_title,
|
||||
"description" => __("En savoir plus sur nos artisans du patrimoine", "metiers-patrimoine-theme"),
|
||||
));
|
||||
?>
|
||||
<?php
|
||||
get_template_part("template-components/heading-box", null, array(
|
||||
"pageIcon" => $pageIcon,
|
||||
"title" => $currentPage->post_title,
|
||||
"description" => __("En savoir plus sur nos artisans du patrimoine", "metiers-patrimoine-theme"),
|
||||
));
|
||||
?>
|
||||
|
||||
</div>
|
||||
<a class="back-to-search" href="<?php echo $searchPageUrl ?>"><?php echo __("Retourner aux résultats de recherche", "metiers-patrimoine-theme") ?></a>
|
||||
<div class="artisan_wrapper">
|
||||
|
||||
<aside class="artisan_info">
|
||||
|
||||
<?php
|
||||
global $post;
|
||||
$post_title = $post->post_title;
|
||||
|
||||
|
||||
get_template_part(
|
||||
'template-components/artisans/card-artisans-single',
|
||||
null,
|
||||
array(
|
||||
'post_ID' => $post->ID,
|
||||
'post_title' => $post_title,
|
||||
)
|
||||
);
|
||||
|
||||
get_template_part(
|
||||
'template-components/artisans/card-taxonomies',
|
||||
null,
|
||||
array(
|
||||
'post_ID' => $post->ID,
|
||||
'post_title' => $post_title,
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</aside>
|
||||
|
||||
<div class="artisans-post">
|
||||
|
||||
<section class="artisans-post__section artisans-post__section--description">
|
||||
<h2 class="artisans-post__section-title"><?php echo __("Activités de l’entreprise", "metiers-patrimoine-theme") ?></h2>
|
||||
|
||||
<?php
|
||||
$company_description = get_field('company_description');
|
||||
$company_members = get_field('company_members');
|
||||
?>
|
||||
<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/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; ?>
|
||||
|
||||
|
||||
</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>
|
||||
|
||||
<?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): ?>
|
||||
<?php foreach ($chantiers->posts as $chantier): ?>
|
||||
<?php
|
||||
$chantier_description = get_field('description', $chantier->ID);
|
||||
$date = get_field('date', $chantier->ID);
|
||||
$city = get_field('city', $chantier->ID);
|
||||
|
||||
?>
|
||||
<div class="chantier">
|
||||
|
||||
<h4 class="chantier__title"><?php echo $chantier->post_title ?></h4>
|
||||
<div class="chantier__infos">
|
||||
<p class="chantier__city"><?php echo $city ?></p>
|
||||
<time class="chantier__date"> <?php echo $date ?></time>
|
||||
</div>
|
||||
<p class="chantier__description"><?php echo $chantier_description ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php endwhile; ?>
|
||||
<?php endif; ?>
|
||||
<?php get_footer();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user