introducing the component
This commit is contained in:
parent
1abe6ca42f
commit
7176e8660a
13
template-components/conseil-patrimoine-redirector.css
Normal file
13
template-components/conseil-patrimoine-redirector.css
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
.post-conseils-chapter-header {
|
||||
@apply bg-patrimoine-sante-securite-light py-2;
|
||||
|
||||
&__page-thematic-title {
|
||||
@apply !text-patrimoine-sante-securite;
|
||||
}
|
||||
&__page-title {
|
||||
@apply !text-3xl font-bold !m-0 pb-3;
|
||||
}
|
||||
&__page-thematic-cover {
|
||||
@apply max-h-80;
|
||||
}
|
||||
}
|
||||
43
template-components/conseil-patrimoine-redirector.php
Normal file
43
template-components/conseil-patrimoine-redirector.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
switch_to_blog(1);
|
||||
|
||||
$patrimoineTermId = 32;
|
||||
$patrimoineTerm = get_term(32, 'thematiques');
|
||||
|
||||
$postConseilPatrimoine = get_posts(array(
|
||||
'post_type' => 'conseils',
|
||||
'posts_per_page' => -1,
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'thematiques',
|
||||
'field' => 'id',
|
||||
'terms' => $patrimoineTermId,
|
||||
'include_children' => false,
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
// write_log($postConseilPatrimoine);
|
||||
|
||||
$postConseilPatrimoineUrl = get_permalink($postConseilPatrimoine[0]->ID);
|
||||
$thematique_picture = get_field('taxonomy_pictures', "thematiques_" . $patrimoineTerm->term_id)['illustration_s'] ?? null;
|
||||
|
||||
restore_current_blog();
|
||||
|
||||
?>
|
||||
|
||||
<section class="post-conseils-chapter-header">
|
||||
<div class="post-conseils-chapter-header__infos">
|
||||
<p class="post-conseils-chapter-header__page-thematic-title"><?php echo $patrimoineTerm->name ?></p>
|
||||
|
||||
|
||||
<h3 class="post-conseils-chapter-header__page-title"><?php echo __("Les conseillères et conseillers Homegrade vous guident", "metiers-patrimoine-theme") ?></h3>
|
||||
|
||||
|
||||
<a class="cta cta--primary cta--button" href="<?php echo $postConseilPatrimoineUrl ?>">
|
||||
<?php echo __("Parcourir nos conseils", "metiers-patrimoine-theme") ?></a>
|
||||
|
||||
</div>
|
||||
<img class="post-conseils-chapter-header__page-thematic-cover " src="<?php echo $thematique_picture['url'] ?>" alt="">
|
||||
</section>
|
||||
Loading…
Reference in New Issue
Block a user