updating pbrochure to only display brochures with pdf url

This commit is contained in:
Antoine M 2023-11-27 13:59:52 +01:00
parent 81bb65f91e
commit 1c7cd647da

View File

@ -37,10 +37,6 @@ get_header();
<?php the_content() ?>
</article>
<?php
?>
<?php get_template_part('template-components/post-conseils/chapter-header', null, array(
'postID' => get_the_ID(),
'title' => __("Retrouvez nos conseils sur l'isolation dans notre brochure écrite par des experts", "homegrade-theme__texte-fonctionnel"),
@ -59,17 +55,21 @@ get_header();
'posts_per_page' => 5,
'orderby' => 'rand',
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => 'brochure_pdf',
'compare' => 'EXISTS'
)
),
);
$suggestedPublications = new WP_Query($args);
$pagePublicationsUrl = get_page_by_template('template-publications.php') ? get_permalink(get_page_by_template('template-publications.php')[0]->ID) : null;
?>
<div class="card-large-content">
<div class="section_titling">
<h2 class="section_titling__title"><?php echo __("Publications suggérées", "homegrade-theme__texte-fonctionnel") ?></h2>
<p class="section_titling__subtitle"><?php echo __("Consultez notre documentation pour en savoir plus", "homegrade-theme__texte-fonctionnel") ?></p>
</div>
<ul id="brochures-rows" class="publications-grid">
<?php
get_template_part(
@ -82,12 +82,9 @@ get_header();
?>
</ul>
<a class="cta cta--outline cta--button mx-auto" href="<?php echo $pagePublicationsUrl ?>"><?php echo __("Consulter toutes les publications", "homegrade-theme__texte-fonctionel") ?></a>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>