diff --git a/single-questions.php b/single-questions.php new file mode 100644 index 0000000..96147d3 --- /dev/null +++ b/single-questions.php @@ -0,0 +1,96 @@ + + + + + slug; + + $args = array( + 'post_type' => 'conseils', + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'slug', + 'terms' => $mainThematique->slug, + ) + ) + ); + $relatedConseils = new WP_Query($args); + $relatedConseilsUrl = get_permalink($relatedConseils->posts[0]->ID) ?? null; + + ?> +
"> + + get_the_ID(), + )); ?> + +
"> + + + +
+ + + + get_the_ID(), + 'title' => __("Retrouvez nos conseils sur l'isolation dans notre brochure écrite par des experts", "homegrade-theme__texte-fonctionnel"), + 'hasInfoCapsule' => false, + 'ctaUrl' => $relatedConseilsUrl, + 'ctaTitle' => __("Consulter nos conseils sur ", "homegrade-theme__texte-fonctionnel") . $mainThematique->name, + 'ctaTarget' => "_self", + + )); ?> + + +
+ 'brochures', + 'posts_per_page' => 5, + 'orderby' => 'rand', + 'post_status' => 'publish', + ); + $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; + + ?> +
+
+

+

+
+ +
    + $suggestedPublications, + ) + ) + ?> +
+ + +
+
+
+ + + + + + +parent ? get_term($thematique->parent, 'thematiques') : $thematique; +$thematique_generale_id_fr = + apply_filters('wpml_object_id', $thematique_generale->term_id, 'thematiques', TRUE, 'fr'); + + +// Récupère la source de l'image par rapport à l'ID FR pour s'assurer de bien synchroniser les images dans les deux langues +$thematique_picture = get_field('taxonomy_pictures', "thematiques_" . $thematique_generale_id_fr)['illustration_s'] ?? null; +$lastUpdate = get_the_modified_date('', $args['postID']); + +$queryArgs = array( + // 'fields' => 'ids', + 'post_type' => 'brochures', + 'posts_per_page' => 1, + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'term_id', + 'terms' => $thematique->term_id + ) + ) +); + +?> + + +
+
+

name ?>

+ + +

+ + + $args['postID'], + "modified" => $lastUpdate + )); + ?> + +
+ +
\ No newline at end of file