From d142147d4ed10c572f6d4cef4de31858ca19d9f2 Mon Sep 17 00:00:00 2001 From: Nonimart Date: Fri, 11 Jul 2025 10:28:12 +0200 Subject: [PATCH] FIX Tweaks on heading box artisans --- resources/css/components/heading-box.css | 15 +++++- resources/css/pages/single-artisans.css | 2 +- single-artisans.php | 64 ++++++++++++++++++------ 3 files changed, 65 insertions(+), 16 deletions(-) diff --git a/resources/css/components/heading-box.css b/resources/css/components/heading-box.css index 7c2be4a..21cacb3 100644 --- a/resources/css/components/heading-box.css +++ b/resources/css/components/heading-box.css @@ -1,7 +1,7 @@ .metiers-patrimoine-page-container--repertoire-metiers, .metiers-patrimoine-page-container--single-artisans { .heading-box { - @apply mt-12 lg:!mt-8 pb-6; + @apply mt-12 2xl:!mt-8 pb-6; &__description { @apply text-3xl max-w-screen-xl font-bold; } @@ -14,4 +14,17 @@ /* width: unset; */ } } + + .heading-box--artisan { + @apply flex flex-col justify-center items-center gap-2 text-center; + + .heading-box__description { + @apply uppercase font-medium text-xl tracking-widest; + line-height: 1.2; + } + .heading-box__subtitle { + @apply font-bold text-4xl pt-0 max-w-3xl pb-4; + text-transform: none; + } + } } diff --git a/resources/css/pages/single-artisans.css b/resources/css/pages/single-artisans.css index bfe4547..2a050d7 100644 --- a/resources/css/pages/single-artisans.css +++ b/resources/css/pages/single-artisans.css @@ -1,6 +1,6 @@ .metiers-patrimoine-page-container--single-artisans { .heading-box { - @apply !mt-8 pb-6 mb-4; + @apply !mt-14 pb-6 mb-4; &__description { @apply text-3xl max-w-screen-xl font-bold; } diff --git a/single-artisans.php b/single-artisans.php index 0f5be7e..e87997e 100644 --- a/single-artisans.php +++ b/single-artisans.php @@ -48,10 +48,10 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null; HEADING BOX ---------------*/ ?> $pageIcon, "title" => $currentPage->post_title, - "description" => __("En savoir plus sur nos artisans du patrimoine", "metiers-patrimoine-theme"), + "description" => __("En savoir plus sur cette entreprise", "metiers-patrimoine-theme"), )); ?> @@ -143,26 +143,62 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null; ); $chantiers = new WP_Query($args); ?> - posts): ?> + posts): ?>

- posts as $chantier): ?> + have_posts()) : $chantiers->the_post(); ?> ID); - $date = get_field('date', $chantier->ID); - $localisation = get_field('localisation', $chantier->ID) ?? null; + $current_chantier_ID = get_the_ID(); + $chantier_description = get_field('description', $current_chantier_ID); + $date = get_field('date', $current_chantier_ID); + $localisation = get_field('localisation', $current_chantier_ID) ?? null; $city = $localisation['city'] ?? null; + $current_id = get_the_ID(); //########## FORCE GET_FIELD IN FR TO BE SURE WE HAVE SAME PICTURES BETWEEN FR AND NL ########## - $chantier_fr_id = apply_filters('wpml_object_id', $chantier->ID, 'chantiers', TRUE, 'fr'); - $current_lang = apply_filters('wpml_current_language', NULL); - do_action('wpml_switch_language', 'fr'); - $pictures = get_field('pictures', $chantier_fr_id); - do_action('wpml_switch_language', $current_lang); + $chantier_fr_id = apply_filters('wpml_object_id', $current_chantier_ID, 'chantiers', TRUE, 'fr'); - $chantier_name = get_field('chantier_name', $chantier->ID); + $current_lang = apply_filters('wpml_current_language', null); + + // Si déjà en français, inutile de switcher + if ($current_lang !== 'fr') { + $pictures = get_field('pictures', $chantier_fr_id); + if ($chantier_fr_id == 2732) { + + write_log($current_lang); + write_log("on est en NL ON SWITCHE"); + do_action('wpml_switch_language', 'fr'); + write_log($chantier_fr_id); + } + do_action('wpml_switch_language', $current_lang); // Revenir à la langue d’origine + + } else { + + $pictures = get_field('pictures', $current_chantier_ID); + $test = get_field_object('pictures', $chantier_fr_id); + if ($chantier_fr_id == 2732) { + // write_log($pictures); + write_log($test); + // write_log($chantier_fr_id); + // write_log($pictures); + write_log(get_the_ID()); + // write_log($pictures); + } + + + // On est déjà en FR, on ne switch pas + } + + + $chantier_name = get_field('chantier_name', $current_chantier_ID); + + if ($chantier_fr_id == 2732) { + // write_log($pictures); + // write_log(apply_filters('wpml_current_language', null)); + // write_log($pictures); + } ?>
@@ -184,7 +220,7 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null; ?>
- +