This commit is contained in:
Nonimart 2025-08-01 10:09:02 +02:00
parent 2a75dd5d00
commit 1a1f1c6e9b
30 changed files with 841 additions and 630 deletions

View File

@ -1,168 +1,171 @@
<?php get_template_part('template-components/footer/page-scroller'); ?>
</main>
<?php do_action('tailpress_content_end'); ?>
<?php do_action('tailpress_content_after'); ?>
<footer id="main_footer" class="site-footer bg-gray-50 py-12" role="contentinfo">
<div class="site-footer-grid-container">
<div class="site-footer__informative-message">
<?php
$theme_locations = get_nav_menu_locations();
$footer_location_ID = $theme_locations['footer'];
$footer_locale_location_ID = apply_filters('wpml_object_id', $footer_location_ID, 'nav_menu', TRUE,);
$theme_locations = get_nav_menu_locations();
?>
<?php $footer_superior_info_message = get_field('footer_superior_info_message', 'term_' . $footer_locale_location_ID); ?>
<?php
?>
<img src='<?php echo get_template_directory_uri() ?>/resources/img/pictogrammes/icone-info.svg' alt=''>
<p class=""><?php echo $footer_superior_info_message['message'] ?></p>
</div>
<div class="site-footer__infos-contact">
<?php $infos_contact = get_field('footer_infos_contact_datagroup', 'term_' . $footer_locale_location_ID); ?>
<div class="point-info">
<h4 class="content-intertitle"><?php echo $infos_contact['point_info']['title'] ?></h4>
<p><?php echo $infos_contact['point_info']['text'] ?></p>
</div>
<div class="permanenc-telephonique">
<?php $footer_superior_info_message = get_field('footer_superior_info_message', 'term_' . $footer_locale_location_ID); ?>
<h4 class="content-intertitle"><?php echo $infos_contact['permanence_telephonique']['title'] ?></h4>
<p><?php echo $infos_contact['permanence_telephonique']['text'] ?></p>
</div>
<div class="en-ligne">
<h4 class="content-intertitle"><?php echo $infos_contact['en_ligne']['title'] ?></h4>
<p><?php echo $infos_contact['en_ligne']['text'] ?></p>
<a class="external-link" href="<?php echo $infos_contact['en_ligne']['form_url'] ?>" target="blank"><?php echo $infos_contact['en_ligne']['form_btn_text'] ?></a>
</div>
</div>
<div class="site-footer__navigation-menu">
<div class="menu-renovateur--footer menu-renovateur">
<?php get_template_part('template-components/footer/menu-renovateur-footer'); ?>
</div>
<?php
wp_nav_menu(
array(
'container' => 'false',
'theme_location' => 'homegrade',
'li_class' => 'menu-navlink',
'fallback_cb' => false,
'menu_class' => 'menu-homegrade--footer',
)
);
?>
<div class="extra_details">
<?php
$social_networks = get_field('social_networks_profiles', "option");
$localizedSiteMapPage = apply_filters('wpml_object_id', 5699, 'page', TRUE);
?>
<a class="cta cta--button cta--outline" href="<?php echo get_the_permalink($localizedSiteMapPage) ?>">
<?php echo get_the_title($localizedSiteMapPage) ?>
</a>
<div class="social-networks">
<a class="cta cta--circular cta--secondary" title="<?php echo __('Facebook', "homegrade-theme__texte-fonctionnel") ?>" href="<?php echo $social_networks['facebook_profile_url'] ?>">
<img src="<?php echo get_template_directory_uri() . '/resources/img/graphic-assets/icone-social-facebook.svg' ?>" alt="">
</a>
<a class="cta cta--circular cta--secondary" title="<?php echo __('Youtube', "homegrade-theme__texte-fonctionnel") ?>" href="<?php echo $social_networks['youtube_profile_url'] ?>">
<img src=" <?php echo get_template_directory_uri() . '/resources/img/graphic-assets/icone-social-youtube.svg' ?>" alt="">
</a>
</div>
</div>
</div>
<ul class="site-footer__partenaires">
<?php $partenaires = get_field('footer_partenaires', 'term_' . $footer_locale_location_ID)['partenaires']; ?>
<?php foreach ($partenaires as $partenaire) : ?>
<li>
<a href=" <?php echo $partenaire['url'] ?>" target="_blank">
<img src='<?php echo $partenaire['logo']['url'] ?>' alt='<?php echo $partenaire['name'] ?>'>
</a>
</li>
<?php endforeach; ?>
</ul>
<div class="site-footer__metiers-patrimoine">
<?php $metiers_patrimoine = get_field('footer_metiers_du_patirmoine', 'term_' . $footer_locale_location_ID); ?>
<h4 class="content-intertitle"><?php echo $metiers_patrimoine['title'] ?> </h4>
<p><?php echo $metiers_patrimoine['text'] ?> </p>
<a class="cta cta cta--primary cta--button" href="<?php echo $metiers_patrimoine['cta_url'] ?> " target="_blank"><?php echo $metiers_patrimoine['cta_text'] ?></a>
</div>
<?php do_action('tailpress_footer'); ?>
</div>
<div class="footer-credits">
<div class="website-credits">
<img class="homegrade-sigle-icon" src="<?php echo get_template_directory_uri() . '/resources/img/logos/logo-homegrade-sigle.svg' ?>" alt="">
<div>
&copy; <?php echo date_i18n('Y'); ?> - <?php echo get_bloginfo('name'); ?>
<p class="made-by" lang="en">Made with
<span class="sr-only">love</span>
<span>
<svg viewBox="0 0 825.22 700.44">
<g>
<path class="cls-1" d="m804.05,123.44c-25.5-54.3-74.5-96-131.6-113.7-56.2-17.5-118.7-11-170.3,17.2-35,19.2-61.9,49.6-89.7,77.6-6.6-6.6-13.2-13.2-19.8-19.8-12-12-23.7-24.7-36.9-35.4C301.75,5.54,229.25-10.56,161.75,6.94,98.25,23.44,43.75,69.54,17.85,129.94c-24,56-23.7,119.1.3,175,12.7,29.7,32.5,54.3,55.1,76.9l52.8,52.8c26.8,26.8,53.6,53.5,80.3,80.3,28.1,28.1,56.2,56.2,84.3,84.3,21.5,21.5,43.1,43.1,64.7,64.7,12.7,12.7,26.3,30.2,44.4,34.9,17,4.4,34.7-.5,47.4-12.3l.6-.6.5-.5,26.9-26.9,67.2-67.2,84.2-84.2,78.4-78.4,49.9-49.9c2.8-2.8,5.7-5.6,8.5-8.5,21.3-21.7,37.5-47.6,48.2-76,20.9-55.2,17.4-117.8-7.5-170.9Z" />
</g>
</svg>
</span> by<a href="https://deligraph.com/" target="_blank"> Deligraph</a>
</p>
</div>
</div>
<ul class="legal-credits">
<?php
$localizedCookiePage = apply_filters('wpml_object_id', 3502, 'page', TRUE);
$localizedConditionsGenerales = apply_filters('wpml_object_id', 3504, 'page', TRUE);
$localizedPolitiqueConfidentialite = apply_filters('wpml_object_id', 3, 'page', TRUE);
$localizedDeclarationAccessibilite = apply_filters('wpml_object_id', 3506, 'page', TRUE);
?>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedConditionsGenerales) ?>"><?php echo get_the_title($localizedConditionsGenerales) ?></a>
</li>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedCookiePage) ?>"><?php echo get_the_title($localizedCookiePage) ?></a>
</li>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedPolitiqueConfidentialite) ?>"><?php echo get_the_title($localizedPolitiqueConfidentialite) ?></a>
</li>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedDeclarationAccessibilite) ?>"><?php echo get_the_title($localizedDeclarationAccessibilite) ?></a>
</li>
</ul>
</div>
</footer>
</div>
<?php wp_footer(); ?>
</body>
<?php
switch_to_blog(1);
?>
<?php get_template_part('template-components/footer/page-scroller'); ?>
</main>
<?php do_action('tailpress_content_end'); ?>
<?php do_action('tailpress_content_after'); ?>
<footer id="main_footer" class="site-footer bg-gray-50 py-12" role="contentinfo">
<div class="site-footer-grid-container">
<div class="site-footer__informative-message">
<?php
$theme_locations = get_nav_menu_locations();
$footer_location_ID = $theme_locations['footer'];
$footer_locale_location_ID = apply_filters('wpml_object_id', $footer_location_ID, 'nav_menu', TRUE,);
$theme_locations = get_nav_menu_locations();
?>
<?php $footer_superior_info_message = get_field('footer_superior_info_message', 'term_' . $footer_locale_location_ID); ?>
<?php
?>
<img src='<?php echo get_template_directory_uri() ?>/resources/img/pictogrammes/icone-info.svg' alt=''>
<p class=""><?php echo $footer_superior_info_message['message'] ?></p>
</div>
<div class="site-footer__infos-contact">
<?php $infos_contact = get_field('footer_infos_contact_datagroup', 'term_' . $footer_locale_location_ID); ?>
<div class="point-info">
<h4 class="content-intertitle"><?php echo $infos_contact['point_info']['title'] ?></h4>
<p><?php echo $infos_contact['point_info']['text'] ?></p>
</div>
<div class="permanenc-telephonique">
<?php $footer_superior_info_message = get_field('footer_superior_info_message', 'term_' . $footer_locale_location_ID); ?>
<h4 class="content-intertitle"><?php echo $infos_contact['permanence_telephonique']['title'] ?></h4>
<p><?php echo $infos_contact['permanence_telephonique']['text'] ?></p>
</div>
<div class="en-ligne">
<h4 class="content-intertitle"><?php echo $infos_contact['en_ligne']['title'] ?></h4>
<p><?php echo $infos_contact['en_ligne']['text'] ?></p>
<a class="external-link" href="<?php echo $infos_contact['en_ligne']['form_url'] ?>" target="blank"><?php echo $infos_contact['en_ligne']['form_btn_text'] ?></a>
</div>
</div>
<div class="site-footer__navigation-menu">
<div class="menu-renovateur--footer menu-renovateur">
<?php get_template_part('template-components/footer/menu-renovateur-footer'); ?>
</div>
<?php
wp_nav_menu(
array(
'container' => 'false',
'theme_location' => 'homegrade',
'li_class' => 'menu-navlink',
'fallback_cb' => false,
'menu_class' => 'menu-homegrade--footer',
)
);
?>
<div class="extra_details">
<?php
$social_networks = get_field('social_networks_profiles', "option");
$localizedSiteMapPage = apply_filters('wpml_object_id', 5699, 'page', TRUE);
?>
<?php
switch_to_blog(2);
$home_url_metiers_patrimoine = get_home_url();
restore_current_blog();
?>
<a class="cta cta--button cta--outline metiers-patrimoine-btn" href="<?php echo $home_url_metiers_patrimoine ?>"><?php echo __('Artisans du patrimoine', 'homegrade') ?></a>
<a class="cta cta--button cta--outline sitemap-btn" href="<?php echo get_the_permalink($localizedSiteMapPage) ?>">
<?php echo get_the_title($localizedSiteMapPage) ?>
</a>
<div class="social-networks">
<a class="cta cta--circular cta--secondary" title="<?php echo __('Facebook', "homegrade-theme__texte-fonctionnel") ?>" href="<?php echo $social_networks['facebook_profile_url'] ?>">
<img src="<?php echo get_template_directory_uri() . '/resources/img/graphic-assets/icone-social-facebook.svg' ?>" alt="">
</a>
<a class="cta cta--circular cta--secondary" title="<?php echo __('Youtube', "homegrade-theme__texte-fonctionnel") ?>" href="<?php echo $social_networks['youtube_profile_url'] ?>">
<img src=" <?php echo get_template_directory_uri() . '/resources/img/graphic-assets/icone-social-youtube.svg' ?>" alt="">
</a>
</div>
</div>
</div>
<ul class="site-footer__partenaires">
<h4 class="content-intertitle"><?php echo __('Nos partenaires', 'metiers-patrimoine-theme') ?></h4>
<?php $partenaires = get_field('footer_partenaires', 'term_' . $footer_locale_location_ID)['partenaires']; ?>
<?php foreach ($partenaires as $partenaire) : ?>
<li>
<a href=" <?php echo $partenaire['url'] ?>" target="_blank">
<img src='<?php echo $partenaire['logo']['url'] ?>' alt='<?php echo $partenaire['name'] ?>'>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php do_action('tailpress_footer'); ?>
</div>
<div class="footer-credits">
<div class="website-credits">
<img class="homegrade-sigle-icon" src="<?php echo get_template_directory_uri() . '/resources/img/logos/logo-homegrade-sigle.svg' ?>" alt="">
<div>
&copy; <?php echo date_i18n('Y'); ?> - <?php echo get_bloginfo('name'); ?>
<p class="made-by" lang="en">Made with
<span class="sr-only">love</span>
<span>
<svg viewBox="0 0 825.22 700.44">
<g>
<path class="cls-1" d="m804.05,123.44c-25.5-54.3-74.5-96-131.6-113.7-56.2-17.5-118.7-11-170.3,17.2-35,19.2-61.9,49.6-89.7,77.6-6.6-6.6-13.2-13.2-19.8-19.8-12-12-23.7-24.7-36.9-35.4C301.75,5.54,229.25-10.56,161.75,6.94,98.25,23.44,43.75,69.54,17.85,129.94c-24,56-23.7,119.1.3,175,12.7,29.7,32.5,54.3,55.1,76.9l52.8,52.8c26.8,26.8,53.6,53.5,80.3,80.3,28.1,28.1,56.2,56.2,84.3,84.3,21.5,21.5,43.1,43.1,64.7,64.7,12.7,12.7,26.3,30.2,44.4,34.9,17,4.4,34.7-.5,47.4-12.3l.6-.6.5-.5,26.9-26.9,67.2-67.2,84.2-84.2,78.4-78.4,49.9-49.9c2.8-2.8,5.7-5.6,8.5-8.5,21.3-21.7,37.5-47.6,48.2-76,20.9-55.2,17.4-117.8-7.5-170.9Z" />
</g>
</svg>
</span> by<a href="https://deligraph.com/" target="_blank">Deligraph</a>
</p>
</div>
</div>
<ul class="legal-credits">
<?php
$localizedCookiePage = apply_filters('wpml_object_id', 3502, 'page', TRUE);
$localizedConditionsGenerales = apply_filters('wpml_object_id', 3504, 'page', TRUE);
$localizedPolitiqueConfidentialite = apply_filters('wpml_object_id', 3, 'page', TRUE);
$localizedDeclarationAccessibilite = apply_filters('wpml_object_id', 3506, 'page', TRUE);
?>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedConditionsGenerales) ?>"><?php echo get_the_title($localizedConditionsGenerales) ?></a>
</li>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedCookiePage) ?>"><?php echo get_the_title($localizedCookiePage) ?></a>
</li>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedPolitiqueConfidentialite) ?>"><?php echo get_the_title($localizedPolitiqueConfidentialite) ?></a>
</li>
<li class="legal-credits__legal-page-link">
<a href="<?php echo get_the_permalink($localizedDeclarationAccessibilite) ?>"><?php echo get_the_title($localizedDeclarationAccessibilite) ?></a>
</li>
</ul>
</div>
</footer>
</div>
<?php
restore_current_blog();
?>
<?php wp_footer(); ?>
</body>
</html>

View File

@ -16,3 +16,4 @@ require_once(__DIR__ . '/includes/wysiwyg.php');
require_once(__DIR__ . '/includes/search.php');
require_once(__DIR__ . '/includes/rooting.php');
require_once(__DIR__ . '/includes/forms.php');
require_once(__DIR__ . '/includes/wpml.php');

View File

@ -8,17 +8,17 @@
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php wp_head(); ?>
</head>
<?php $currentLanguage = apply_filters('wpml_current_language', null); ?>
<?php
$currentLanguage = apply_filters('wpml_current_language', null);
switch_to_blog(1)
?>
<body <?php body_class("homegrade-frontend-page ") ?> current-language="<?php echo $currentLanguage ?? "" ?>">
<?php
do_action('tailpress_site_before');
global $post;
?>
<div id="page-<?php echo $post->post_name ?? "" ?>" class="min-h-screen flex flex-col ">
<div class="skiplinks" aria-label="<?php echo __('Accès rapide', 'homegrade-theme__texte-fonctionnel') ?>">
@ -31,13 +31,11 @@
<?php do_action('tailpress_header'); ?>
<header id="main-header">
<!-- MENU MOBILE -->
<?php
get_template_part('template-components/header/mobile-brand');
?>
<?php get_template_part('template-components/header/mobile-brand'); ?>
<!-- MENU HOMEGRADE -->
<?php get_template_part('template-components/header/menu-homegrade'); ?>
<?php get_template_part('template-components/header/menu-renovateur'); ?>
@ -47,5 +45,7 @@
<?php do_action('tailpress_content_start'); ?>
<main id="content" class="site-content flex-grow">
<main id="content" class="site-content flex-grow">
<?php
restore_current_blog();
?>

View File

@ -7,15 +7,14 @@
function register_theme_settings_option_page()
{
$current_blog_id = get_current_blog_id();
// Check function exists.
if (function_exists('acf_add_options_page')) {
if (function_exists('acf_add_options_page') && $current_blog_id === 1) {
// Register options page.
$homegrade_option_page = acf_add_options_page(array(
'page_title' => __('Paramètres & Outils', 'homegrade-theme__texte-backoffice'),
'menu_title' => __('Paramètres', 'homegrade-theme__texte-backoffice'),
'menu_slug' => 'theme-general-settings',
'capability' => 'activate_plugins',
'redirect' => false,

View File

@ -7,8 +7,6 @@ function add_menu_item($menu_items)
return $menu_items;
}
function homegrade_stats_option_page()
{
?>
@ -90,9 +88,6 @@ function generate_order_datas_to_csv()
$document_id_nl = $document['id_nl'] ?? null;
$document_quantity_nl = $document['quantity_nl'] ?? null;
$dateCreatedRaw = $entry['date_created'] ?? '';
$dateCreated = $dateCreatedRaw ? date('d / m / Y', strtotime($dateCreatedRaw)) : '';
if (!$document_quantity_fr && !$document_quantity_nl) {
continue;
}
@ -108,7 +103,6 @@ function generate_order_datas_to_csv()
'company_type' => $companyType,
'zipCode' => $zipCode,
'userLanguage' => $userLanguage,
'order_date' => $dateCreated,
];
array_push($output_formatted_entries, $document_formatted_order_nl);
}
@ -125,7 +119,6 @@ function generate_order_datas_to_csv()
'company_type' => $companyType,
'zipCode' => $zipCode,
'userLanguage' => $userLanguage,
'order_date' => $dateCreated,
];
array_push($output_formatted_entries, $document_formatted_order_fr);
}
@ -143,7 +136,7 @@ function generate_order_datas_to_csv()
}
// Ajouter les en-têtes du CSV
fputcsv($file, ['Publication', 'Quantité', 'Langue de la publication', 'Thématique', 'ID de la brochure', 'Type d\'organisme', 'Code Postal', 'Langue de l\'utilisateur', 'Date de la commande']);
fputcsv($file, ['Publication', 'Quantité', 'Langue de la publication', 'Thématique', 'ID de la brochure', 'Type d\'organisme', 'Code Postal', 'Langue de l\'utilisateur']);
// Boucler sur chaque entrée formatée et l'écrire dans le CSV
foreach ($output_formatted_entries as $entry) {

View File

@ -4,6 +4,7 @@
* Theme setup.
*/
function tailpress_setup()
{
@ -61,7 +62,7 @@ function homegrade_enqueue_scripts()
wp_enqueue_script('gsap', get_template_directory_uri() . '/assets/gsap/gsap.min.js', array(), $theme->get('Version'));
wp_enqueue_script('swiperjs', get_template_directory_uri() . '/assets/swiper/swiper-bundle_11.min.js', array(), $theme->get('Version'));
wp_enqueue_style('swipercss', get_template_directory_uri() . '/assets/swiper/swiper-bundle.min.css', array(), $theme->get('Version'));
wp_enqueue_style('tailpress', tailpress_asset('css/app.css'), array(), $theme->get('Version'));
wp_enqueue_style('homegrade-main-css', get_template_directory_uri() . '/css/app.css', array(), $theme->get('Version'));
// #PASSING TRANSLATIONS
wp_register_script('main-app-js', get_template_directory_uri() . '/js/app.js', array('gsap', 'jquery'), $theme->get('Version'));
@ -89,6 +90,15 @@ add_action('wp_enqueue_scripts', 'homegrade_enqueue_scripts');
Enqueue Theme assets 🡒 Back
-----------------------------------------------------------*/
add_action('enqueue_block_editor_assets', 'homegrade_enqueue_scripts');
function homegrade_enqueue_back_scripts()
{
wp_enqueue_script('metiers-theme-editor-js', get_stylesheet_directory_uri() . '/js/editor.js', array(), $theme->get('Version'));
}
add_action('enqueue_block_editor_assets', 'homegrade_enqueue_scripts');
// ALSO SEE add_editor_style('css/editor-style.css') line 41

View File

@ -16,38 +16,85 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
$output = '<h6 class="page-group-title">' . $item->title . '</h6>';
}
// #### MENU RENOVATEUR
// if ($args->theme_location === "renovateur") {
// $page_icon = get_field('page_icon', $item->object_id);
// if (in_array('menu-item-has-children', $item->classes, true)) {
// $output = '<button type="button" class="footer__submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
// }
// // #### ICONE DE PAGE FOR TOP LEVEL MENU ITEMS
// if (isset($page_icon['url'])) {
// $icon = '<img class="page_icon" src="' . $page_icon['url'] . '" alt=""/>';
// $link = $output;
// $output = $icon . $link;
// }
// // #### TAXONOMY : GET ICON & INFOS ABOUT TAX
// if ($item->type === "taxonomy") {
// $term = get_term_by('id', $item->object_id, 'thematiques');
// $cover = get_field('taxonomy_pictures', "thematiques_" . $item->object_id);
// $output = '<a class="lol" href="' . $item->url . '">';
// $output .= '<img class="thematique-icon" src="' . $cover['icon']['url'] . '"/>';
// $output .= '<h6>' . $item->title . "</h6>";
// $output .= '<p>' . $term->description . "</p>";
// $output .= "</a>";
// }
// }
return $output;
}
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
/* -----------------------------------------------------------
Hide Page presse from homegrade top-menu but not footer
-----------------------------------------------------------*/
function metiers_patrimoine_filter_menu_items($items, $args)
{
// ID de l'élément de menu à masquer
$isMenuHomegradeInFooter = $args->menu_class === 'menu-homegrade--footer';
foreach ($items as $key => $item) {
$isPagePresse = $item->object_id == "2784" || $item->object_id == "4973";
if ($isPagePresse && !$isMenuHomegradeInFooter) {
unset($items[$key]);
}
}
return $items;
}
add_filter('wp_nav_menu_objects', 'metiers_patrimoine_filter_menu_items', 10, 2);
/* -----------------------------------------------------------
PASS CUSTOM WPML NAV SWITCHER TO MENU
-----------------------------------------------------------*/
add_filter('wp_nav_menu_items', 'add_custom_item_to_menu', 10, 2);
function add_custom_item_to_menu($items, $args)
{
$isMenuHomegradeInFooter = $args->menu_class === 'menu-homegrade--footer';
// restore_current_blog();
if ($args->theme_location === 'homegrade' && !$isMenuHomegradeInFooter) {
/* BOUTON METIERS DU PATRIMOINE */
switch_to_blog(2);
// $home_url_metiers_patrimoine = get_home_url();
$home_url_metiers_patrimoine = get_the_permalink(43);
// switch_to_blog(1);
restore_current_blog();
$items .= '<li id="menu-item-artisan-du-patrimoine" class="menu-item menu-item-type-post_type menu-item-object-page menu-navlink ">';
$items .= '<a href="' . $home_url_metiers_patrimoine . '">';
$items .= __('Artisans du patrimoine', 'homegrade');
$items .= '</a>';
$items .= '</li>';
/* WPML NAV SWITCHER */
ob_start();
// switch_to_blog(1);
restore_current_blog();
// do_action('wpml_language_switcher', array('flags' => false, 'translated' => false, 'link_current' => true));
do_action('wpml_add_language_selector');
switch_to_blog(1);
$wpmlnav = ob_get_clean();
$items .= '<li class="menu-item menu-item-type-post_type menu-item-object-page menu-navlink">';
$items .= $wpmlnav;
$items .= '</li>';
}
// switch_to_blog(1);
return $items;
}

View File

@ -1,202 +1,204 @@
<?php
// Change Defaults Posts to "News" in menu bar
function cp_change_post_object()
{
$get_post_type = get_post_type_object('post');
$labels = $get_post_type->labels;
$labels->name = 'News';
$labels->singular_name = 'News';
$labels->add_new = 'Ajouter une Actu';
$labels->add_new_item = 'Ajouter une Actu';
$labels->edit_item = 'Editer l\'actualité';
$labels->new_item = 'News';
$labels->view_item = 'Voir l\'actualité';
$labels->search_items = 'Chercher une Actualité';
$labels->not_found = 'Pas de News trouvée';
$labels->not_found_in_trash = 'Pas de News trouvée dans la corbeille';
$labels->all_items = 'Toutes les Actus';
$labels->menu_name = 'News';
$labels->name_admin_bar = 'News';
}
add_action('init', 'cp_change_post_object');
// Change Defaults Posts Icon in menu bar
function change_menu_icon()
{
// Access global variables.
global $menu;
foreach ($menu as $key => $val) {
if (__('News', 'homegrade-theme__texte-backoffice') == $val[0]) {
$menu[$key][6] = 'dashicons-welcome-widgets-menus';
}
}
}
add_action('admin_menu', 'change_menu_icon');
// #### POST TYPES
function create_posttype()
{
// **** CONSEILS
register_post_type(
'conseils',
array(
'labels' => array(
'name' => __('Conseils', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Conseil', 'homegrade-theme__texte-backoffice')
),
'template' => [
array('homegrade-content-blocks/chapter-header'),
array('core/paragraph', ['placeholder' => 'Add truc Description…',]),
],
'hierarchical' => true,
'public' => true,
'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-pressthis',
'menu_position' => 2,
'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'),
// 'supports' => array('title', 'custom-fields', 'editor'),
)
);
// **** BROCHURES
register_post_type(
'brochures',
array(
'labels' => array(
'name' => __('Brochures', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Brochure', 'homegrade-theme__texte-backoffice')
),
'hierarchical' => true,
'show_in_rest' => true,
'public' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-book',
'menu_position' => 2,
'position' => 2,
'supports' => array('custom-fields', 'page-attributes', 'title'),
)
);
// **** QUESTIONS
register_post_type(
'questions',
array(
'labels' => array(
'name' => __('Questions', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Question', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-editor-help',
'menu_position' => 2.1,
'supports' => array('title', 'custom-fields', 'editor', 'excerpt', 'revisions'),
// 'rewrite' => array('slug' => 'questions'),
// 'rewrite' => array('slug' => 'questions/%thematiques%'),
)
);
// **** FICHES-INFOS
register_post_type(
'fiches-infos',
array(
'labels' => array(
'name' => __('Fiches info', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Fiches Info', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-info-outline',
'menu_position' => 2.1,
'supports' => array('title', 'custom-fields'),
)
);
// **** VOCABULAIRE
register_post_type(
'vocabulaire',
array(
'labels' => array(
'name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-testimonial',
'menu_position' => 5.1,
'supports' => array('title', 'custom-fields'),
)
);
// **** JOBS
register_post_type(
'jobs',
array(
'labels' => array(
'name' => __('Jobs', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Job', 'homegrade-theme__texte-backoffice')
),
'rewrite' => array('slug' => 'job'),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-id-alt',
'menu_position' => 5.1,
'supports' => array('title', 'editor', 'custom-fields', 'page-attributes'),
)
);
// **** VIDEOS / WEBINAIRES
register_post_type(
'videos-webinaires',
array(
'labels' => array(
'name' => __('Webinaires', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Webinaire', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-video-alt2',
'menu_position' => 5.1,
'supports' => array('title', 'custom-fields'),
'supports' => array('title', 'custom-fields', 'excerpt', 'thumbnail'),
)
);
// **** VIDEOS / WEBINAIRES
register_post_type(
'parcours',
array(
'labels' => array(
'name' => __('Parcours', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Parcours', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => true,
'hierarchical' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-forms',
'supports' => array('title', 'custom-fields'),
'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'),
)
);
}
add_action('init', 'create_posttype');
<?php
// Change Defaults Posts to "News" in menu bar
function cp_change_post_object()
{
$get_post_type = get_post_type_object('post');
$labels = $get_post_type->labels;
$labels->name = 'News';
$labels->singular_name = 'News';
$labels->add_new = 'Ajouter une Actu';
$labels->add_new_item = 'Ajouter une Actu';
$labels->edit_item = 'Editer l\'actualité';
$labels->new_item = 'News';
$labels->view_item = 'Voir l\'actualité';
$labels->search_items = 'Chercher une Actualité';
$labels->not_found = 'Pas de News trouvée';
$labels->not_found_in_trash = 'Pas de News trouvée dans la corbeille';
$labels->all_items = 'Toutes les Actus';
$labels->menu_name = 'News';
$labels->name_admin_bar = 'News';
}
add_action('init', 'cp_change_post_object');
// Change Defaults Posts Icon in menu bar
function change_menu_icon()
{
// Access global variables.
global $menu;
foreach ($menu as $key => $val) {
if (__('News', 'homegrade-theme__texte-backoffice') == $val[0]) {
$menu[$key][6] = 'dashicons-welcome-widgets-menus';
}
}
}
add_action('admin_menu', 'change_menu_icon');
// #### POST TYPES
function create_posttype()
{
if (get_current_blog_id() != 1) {
return;
}
// **** CONSEILS
register_post_type(
'conseils',
array(
'labels' => array(
'name' => __('Conseils', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Conseil', 'homegrade-theme__texte-backoffice')
),
'template' => [
array('homegrade-content-blocks/chapter-header'),
array('core/paragraph', ['placeholder' => 'Add truc Description…',]),
],
'hierarchical' => true,
'public' => true,
'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-pressthis',
'menu_position' => 2,
'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'),
// 'supports' => array('title', 'custom-fields', 'editor'),
)
);
// **** BROCHURES
register_post_type(
'brochures',
array(
'labels' => array(
'name' => __('Brochures', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Brochure', 'homegrade-theme__texte-backoffice')
),
'hierarchical' => true,
'show_in_rest' => true,
'public' => true,
'has_archive' => false,
'menu_icon' => 'dashicons-book',
'menu_position' => 2,
'position' => 2,
'supports' => array('custom-fields', 'page-attributes', 'title'),
)
);
// **** QUESTIONS
register_post_type(
'questions',
array(
'labels' => array(
'name' => __('Questions', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Question', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-editor-help',
'menu_position' => 2.1,
'supports' => array('title', 'custom-fields', 'editor', 'excerpt', 'revisions'),
// 'rewrite' => array('slug' => 'questions'),
// 'rewrite' => array('slug' => 'questions/%thematiques%'),
)
);
// **** FICHES-INFOS
register_post_type(
'fiches-infos',
array(
'labels' => array(
'name' => __('Fiches info', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Fiches Info', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-info-outline',
'menu_position' => 2.1,
'supports' => array('title', 'custom-fields'),
)
);
// **** VOCABULAIRE
register_post_type(
'vocabulaire',
array(
'labels' => array(
'name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-testimonial',
'menu_position' => 5.1,
'supports' => array('title', 'custom-fields'),
)
);
// **** JOBS
register_post_type(
'jobs',
array(
'labels' => array(
'name' => __('Jobs', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Job', 'homegrade-theme__texte-backoffice')
),
'rewrite' => array('slug' => 'job'),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-id-alt',
'menu_position' => 5.1,
'supports' => array('title', 'editor', 'custom-fields', 'page-attributes'),
)
);
// **** VIDEOS / WEBINAIRES
register_post_type(
'videos-webinaires',
array(
'labels' => array(
'name' => __('Webinaires', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Webinaire', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-video-alt2',
'menu_position' => 5.1,
'supports' => array('title', 'custom-fields'),
'supports' => array('title', 'custom-fields', 'excerpt', 'thumbnail'),
)
);
// **** VIDEOS / WEBINAIRES
register_post_type(
'parcours',
array(
'labels' => array(
'name' => __('Parcours', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Parcours', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => true,
'hierarchical' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-forms',
'supports' => array('title', 'custom-fields'),
'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'),
)
);
}
add_action('init', 'create_posttype');

View File

@ -196,8 +196,8 @@ function build_page_chapter_index($blocks)
if ($block['blockName'] == 'homegrade-content-blocks/content-heading' && isset($block['attrs']['title']) && isset($block['attrs']['headingLevel']) && $block['attrs']['headingLevel'] == "h2") {
array_push($chapterBlockIndex, [
'block-type' => $block['blockName'],
'anchor' => "#" . strip_tags($block['attrs']['idName']),
'title' => strip_tags($block['attrs']['title']),
'anchor' => "#" . esc_html($block['attrs']['idName']),
'title' => esc_html($block['attrs']['title']),
]);
}
if ($block['blockName'] == 'homegrade-content-blocks/chapitrage-thematique') {

View File

@ -1,15 +1,10 @@
{
"name": "tailpress",
"name": "Homegrade_Theme",
"version": "3.0.0",
"description": "Boilerplate WordPress theme with Tailwind CSS.",
"author": "Jeffrey van Rossum",
"repository": {
"type": "git",
"url": "https://github.com/jeffreyvr/tailpress"
},
"theme_uri": "https://github.com/jeffreyvr/tailpress",
"author_uri": "https://vanrossum.dev",
"text_domain": "tailpress",
"description": "Homegrade Theme",
"author": "Deligraph — Antoine Martinon",
"author_uri": "https://deligraph.be/",
"text_domain": "homegrade-theme",
"license": "MIT",
"scripts": {
"production:css-app": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/app.css -o ./css/app.css --postcss --minify",

View File

@ -224,22 +224,3 @@
@apply bg-patrimoine-sante-securite;
}
}
ol {
@apply list-decimal list-inside;
/* font-family: 'Railway', sans-serif; */
li {
list-style-type: decimal !important;
list-style-position: inside !important;
position: relative !important;
padding-left: 1.5em !important;
}
li:marker {
position: absolute !important;
left: 0 !important;
}
.block-editor-rich-text__editable {
display: inline-block !important;
}
}

View File

@ -31,8 +31,10 @@
@import './components/thematiques-faq-filters.css';
@import './components/checkboxes.css';
@import './components/search-results.css';
@import './components/side-card.css';
@import './components/accordeons.css';
@import './components/page-scroller.css';
@import './components/informative-message.css';
@import './components/previous-next-posts.css';
@import './components/forms/field-order-publications.css';
@import './components/forms/field-homegrade-rating.css';
@ -121,6 +123,7 @@
@import './blocks/page-card.css';
@import './blocks/lightbox-gallery.css';
@import './blocks/explainer-screen.css';
@import './blocks/cta-slim.css';
/* Home */
@import './blocks/home-header.css';

View File

@ -26,7 +26,7 @@ main
a[target='_blank']:not([href*='homegrade\.local']):not([href*='homegrade\.brussels']):not(
:has(img)
) {
&:not(.cta--primary, .cta--secondary, .cta--button, .wp-block-button__link) {
&:not(.cta--primary, .cta--secondary, .cta--button, .share-link, .wp-block-button__link) {
@apply inline items-center;
@apply px-2 py-1 first-letter:text-primary underline font-bold relative rounded-md;

View File

@ -44,3 +44,9 @@
margin-bottom: unset;
}
}
.block-content-page-header {
.homegrade-blocks-cta-slim + .homegrade-blocks-shortcuts {
@apply mt-12;
}
}

View File

@ -0,0 +1,14 @@
.homegrade-blocks-cta-slim {
@apply flex items-center font-bold pt-2 w-fit rounded-md;
&:after {
@apply ml-2;
transition: transform 0.2s ease-in-out;
/* @apply content-[''] w-4 h-4 bg-green-400 inline-block; */
content: url('../resources/img/graphic-assets/chevron-next.svg');
}
&:hover:after {
@apply translate-x-1;
transition: transform 0.2s ease-in-out;
/* @apply translate-x-2; */
}
}

View File

@ -81,3 +81,87 @@
pt-16;
}
}
.swiper-content {
@apply lg:px-24 relative max-w-screen-2xl mx-auto;
/* @apply bg-fuchsia-100; */
}
.swiper-container {
height: auto;
@apply px-3 overflow-hidden;
/* @apply bg-yellow-50; */
}
.swiper-wrapper {
@apply pt-24 pb-16 w-full flex-col lg:flex-row gap-y-20;
}
.swiper-slide {
@apply h-auto;
.card-thematique {
@apply h-full;
}
}
.thematique-button-next,
.thematique-button-prev {
@apply absolute top-1/2 z-50 opacity-80 hidden lg:block;
width: 60px;
height: 60px;
&:hover,
&:focus-visible {
@apply opacity-100;
filter: invert(13%) sepia(71%) saturate(4425%) hue-rotate(338deg) brightness(109%)
contrast(117%);
}
&:focus-visible {
@apply rounded-full;
}
}
.thematique-button-next {
@apply right-0 transform;
}
.thematique-button-prev {
@apply left-0;
}
.swiper-pagination {
@apply hidden lg:block;
}
.swiper-pagination-bullet {
@apply w-5 h-5 !mx-2 opacity-100 bg-white !border-2 !border-solid border-black;
}
.swiper-pagination-bullet:focus-visible {
outline-offset: 4px;
}
.swiper-pagination-bullet-active {
@apply bg-secondary !border-secondary opacity-100;
}
/* .swiper-slide {
background-color: red !important;
text-align: center;
font-size: 18px;
background: #fff;
display: flex;
justify-content: center;
align-items: center;
}
.swiper-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
} */
.section-show-thematiques {
@apply pt-8 pb-8 px-8 md:px-16;
.thematiques-container {
@apply grid
grid-cols-3
gap-8
gap-y-32
max-w-screen-xl
mx-auto
pt-16;
}
}

View File

@ -21,6 +21,9 @@
@apply bg-primary text-white
hover:bg-primary-hover;
}
&--patrimoine {
@apply !bg-patrimoine-sante-securite !text-white;
}
&--white {
@apply bg-white text-secondary
hover:bg-primary-hover;

View File

@ -1,6 +1,7 @@
form:not(.metabox-location-side):not(.metabox-location-normal):not(
.metabox-location-advanced,
.search-module__search-form
.search-module__search-form,
.metier-patrimoine-searchform
) {
--secondary: #df1e1e;
--secondary-darker: #bd1515;

View File

@ -38,15 +38,32 @@
}
.extra_details {
@apply flex flex-wrap items-center justify-between;
@apply flex flex-wrap items-center justify-between gap-4;
.sitemap-btn,
.metiers-patrimoine-btn {
@apply !py-3 !px-5;
}
.metiers-patrimoine-btn {
@apply flex items-center justify-center;
&::before {
@apply w-6 h-6 mr-2 block bg-contain bg-center bg-no-repeat content-[''];
background-image: url('../resources/img/pictogrammes/Homegrade_artisans-patrimoine.svg');
}
}
.social-networks {
@apply flex gap-4;
@apply flex gap-4 ml-auto;
}
}
}
&__partenaires {
@apply flex flex-wrap col-span-4 md:col-span-2 justify-center items-center gap-12;
@apply flex flex-wrap col-span-4 justify-center items-center gap-x-12;
.content-intertitle {
@apply w-full text-center;
}
a img {
@apply inline-block;
}

View File

@ -182,11 +182,64 @@
@apply hidden;
}
}
.wpml-ls-item-nl {
@apply xl:ml-8;
/* .wpml-ls-legacy-list-horizontal {
@apply p-0;
} */
.wpml-ls {
@apply !p-0;
}
/* .wpml-ls-item-nl {
@apply xl:ml-8;
} */
.wpml-ls-legacy-dropdown-click {
@apply !w-fit mt-4 lg:mt-0;
/* margin-left: -10px !important; */
ul {
@apply border-none lg:!px-2;
}
ul.wpml-ls-sub-menu {
@apply !pb-2 bg-primary static lg:absolute;
@media screen and (max-width: 960px) {
@apply !visible;
}
}
a {
@apply !bg-transparent !text-white border-none;
}
a:hover {
@apply rounded-lg font-bold;
background-color: rgba(255, 255, 255, 0.1) !important;
}
a.wpml-ls-item-toggle {
@apply lg:!px-5;
}
a.wpml-ls-item-toggle:after {
@apply !content-none lg:!content-[''];
right: 0px;
display: inline-block;
transition: all 0.3s ease-out;
border: unset;
border-bottom: 2px solid white;
border-right: 2px solid white;
height: 8px;
width: 8px;
/* margin-left: 10px;
margin-left: 20px; */
transform: rotate(45deg);
}
}
.wpml-ls-item {
@apply px-1 inline-block mb-3 lg:mb-0;
@apply bg-transparent text-white;
}
/* OLD LANGUAGE SELECTOR LOOK */
/* .wpml-ls-item {
@apply !px-1 inline-block mb-3 lg:mb-0;
a {
@apply !rounded-full h-10 w-10 border-2 border-white p-0 !flex justify-center items-center font-semibold text-sm;
@ -197,15 +250,15 @@
a:hover {
@apply !bg-white text-primary font-bold;
}
}
.wpml-ls-current-language {
} */
/* .wpml-ls-current-language {
a {
@apply bg-white text-primary font-bold;
}
a:focus-visible {
@apply !bg-white text-primary font-bold;
}
}
} */
}
.menu-homegrade--footer {

View File

@ -140,6 +140,7 @@ export default function menuInit() {
HANDLE SEARCH
-----------------------------------------------------------*/
function isSearchOpen() {
if (!searchModule) return null;
// IF CLOSED
if (
searchModule.getAttribute('mobile-closed') != null &&

View File

@ -6,7 +6,6 @@
<input class="search-module__search-form__input" type="text" name="s" id="search" value="<?php the_search_query(); ?>" placeholder="<?php echo __('Rechercher dans le site. Taper vos mots-clés ici', 'homegrade-theme__texte-fonctionnel') ?>" />
<button type="submit">
<span><?php echo __('Rechercher', 'homegrade-theme__texte-fonctionnel') ?></span>
<img class="search_icon" src='<?php echo get_template_directory_uri() ?>/resources/img/graphic-assets/search-icon.svg' alt=''>

View File

@ -1,125 +1,127 @@
<?php
get_header();
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$currentThematique = get_the_terms(get_the_ID(), 'thematiques')[0];
$mainThematique = getMainThematique($currentThematique);
$thematiqueColorSlug = $mainThematique->slug;
?>
<div class="post-conseil-page-container <?php echo $thematiqueColorSlug ? "post-conseil-page--" . $thematiqueColorSlug : "" ?>">
<nav class=" breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
<?php
$archiveConseils = get_page_by_template('template-archive-conseils.php')[0];
?>
<ol>
<li>
<a href="<?php echo home_url() ?>" 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>
<li><a href="<?php echo get_post_permalink($archiveConseils) ?>"><?php echo $archiveConseils->post_title ?></a></li>
<?php if ($mainThematique != $currentThematique) : ?>
<?php
$args = array(
'post_type' => 'conseils', // the post type
'tax_query' => array(
array(
'taxonomy' => 'thematiques', // the custom vocabulary
'field' => 'term_id', // term_id, slug or name
'terms' => array($mainThematique->term_id),
'include_children' => false,
),
),
);
$mainThematiqueRelatedConseil = get_posts($args)[0] ?? null;
?>
<li><a href="<?php echo get_post_permalink($mainThematiqueRelatedConseil) ?>"><?php echo $mainThematique->name ?></a></li>
<?php endif; ?>
<li><a href="<?php echo the_permalink() ?>" aria-current="location" aria-disabled="true"><?php echo $currentThematique->name ?></a></li>
</ol>
</nav>
<?php /* -------
CHAPTER HEADER
---------------*/ ?>
<?php
$blocks = parse_blocks($post->post_content);
$chapterBlockIndex = build_page_chapter_index($blocks); // see utilities.php
$queryArgs = array(
'post_type' => 'brochures',
'posts_per_page' => 1,
'status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'thematiques',
'field' => 'term_id',
'terms' => $currentThematique->term_id,
'include_children' => false,
)
)
);
$relatedBrochuresPosts = get_posts($queryArgs);
$relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? null;
$hasManualDocument = get_field('manual_source_document') ?? null;
$manualSrcDocument = get_field('manual_document_link');
$relatedDocumentUrl = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['source_document']) ? $manualSrcDocument['source_document']['url'] : $relatedBrochure['url'] ?? null;
$relatedDocumentCtaTitle = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['button_title']) ? $manualSrcDocument['button_title'] : __("Télécharger la brochure ", "homegrade-theme__texte-fonctionnel");
get_template_part('template-components/post-conseils/chapter-header', null, array(
'postID' => get_the_ID(),
'subtitle' => __("Les conseillers Homegrade vous guident", "homegrade-theme__texte-fonctionnel"),
'title' => get_the_title(get_the_ID()),
'ctaUrl' => $relatedDocumentUrl,
'ctaTitle' => $relatedDocumentCtaTitle,
'hasInfoCapsule' => true,
)); ?>
<?php /* -------
CONSEIL
---------------*/ ?>
<div class=" conseils_wrapper">
<!-- CHAPTER INDEX -->
<aside class="chapter_index">
<?php if ($chapterBlockIndex) : ?>
<div class="chapter_index__titling">
<div class="icon">
<img src="<?php echo get_template_directory_uri() . '/resources/img/graphic-assets/icon-feather-menu.svg' ?>" alt="">
</div>
<h2 class="chapter_index__title"> <?php echo __("Dans ce conseil", "homegrade-theme__texte-fonctionnel") ?> </h2>
</div>
<ul class="chapter_index__list">
<div class="chapter_index__position-indicator"></div>
<?php foreach ($chapterBlockIndex as $chapter) : ?>
<li class="chapter_index__link"><a href="<?php echo $chapter['anchor'] ?>"><?php echo $chapter['title'] ?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</aside>
<!-- ARTICLE -->
<article class="entry-content single-editor-content <?php echo $thematiqueColorSlug ? "entry-content--" . $thematiqueColorSlug : "" ?>">
<?php the_content() ?>
</article>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php
get_footer();
<?php
get_header();
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$currentThematique = get_the_terms(get_the_ID(), 'thematiques')[0];
$mainThematique = getMainThematique($currentThematique);
$thematiqueColorSlug = $mainThematique->slug;
?>
<div class="post-conseil-page-container <?php echo $thematiqueColorSlug ? "post-conseil-page--" . $thematiqueColorSlug : "" ?>">
<nav class=" breadcrumbs_navigation" aria-label="<?php echo __("Vous êtes ici", "homegrade-theme__texte-fonctionnel") ?>">
<?php
$archiveConseils = get_page_by_template('template-archive-conseils.php')[0];
?>
<ol>
<li>
<a href="<?php echo home_url() ?>" 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>
<li><a href="<?php echo get_post_permalink($archiveConseils) ?>"><?php echo $archiveConseils->post_title ?></a></li>
<?php if ($mainThematique != $currentThematique) : ?>
<?php
$args = array(
'post_type' => 'conseils', // the post type
'tax_query' => array(
array(
'taxonomy' => 'thematiques', // the custom vocabulary
'field' => 'term_id', // term_id, slug or name
'terms' => array($mainThematique->term_id),
'include_children' => false,
),
),
);
$mainThematiqueRelatedConseil = get_posts($args)[0] ?? null;
?>
<li><a href="<?php echo get_post_permalink($mainThematiqueRelatedConseil) ?>"><?php echo $mainThematique->name ?></a></li>
<?php endif; ?>
<li><a href="<?php echo the_permalink() ?>" aria-current="location" aria-disabled="true"><?php echo $currentThematique->name ?></a></li>
</ol>
</nav>
<?php /* -------
CHAPTER HEADER
---------------*/ ?>
<?php
$blocks = parse_blocks($post->post_content);
$chapterBlockIndex = build_page_chapter_index($blocks); // see utilities.php
$queryArgs = array(
'post_type' => 'brochures',
'posts_per_page' => 1,
'status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'thematiques',
'field' => 'term_id',
'terms' => $currentThematique->term_id,
'include_children' => false,
)
)
);
$relatedBrochuresPosts = get_posts($queryArgs);
$relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? null;
$hasManualDocument = get_field('manual_source_document') ?? null;
$manualSrcDocument = get_field('manual_document_link');
$relatedDocumentUrl = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['source_document']) ? $manualSrcDocument['source_document']['url'] : $relatedBrochure['url'] ?? null;
$relatedDocumentCtaTitle = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['button_title']) ? $manualSrcDocument['button_title'] : __("Télécharger la brochure ", "homegrade-theme__texte-fonctionnel");
get_template_part('template-components/post-conseils/chapter-header', null, array(
'postID' => get_the_ID(),
'subtitle' => __("Les conseillers Homegrade vous guident", "homegrade-theme__texte-fonctionnel"),
'title' => get_the_title(get_the_ID()),
'ctaUrl' => $relatedDocumentUrl,
'ctaTitle' => $relatedDocumentCtaTitle,
'hasInfoCapsule' => true,
));
?>
<?php /* -------
CONSEIL
---------------*/ ?>
<div class=" conseils_wrapper">
<!-- CHAPTER INDEX -->
<aside>
<?php if ($chapterBlockIndex) {
get_template_part('template-components/post-conseils/chapter-index', null, array(
'chapterBlockIndex' => $chapterBlockIndex,
));
} ?>
<?php
if ($mainThematique->term_id == 59 || $mainThematique->term_id == 32) {
get_template_part('template-components/post-conseils/find-artisan', null, array());
}
?>
</aside>
<!-- ARTICLE -->
<article class="entry-content single-editor-content <?php echo $thematiqueColorSlug ? "entry-content--" . $thematiqueColorSlug : "" ?>">
<?php the_content() ?>
</article>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php
get_footer();

View File

@ -19,7 +19,7 @@ get_header();
'taxonomy' => 'thematiques',
'field' => 'slug',
'terms' => $mainThematique->slug,
)
)
)
);
$relatedConseils = new WP_Query($args);

View File

@ -77,7 +77,7 @@ module.exports = {
md: '782px',
lg: tailpress.theme('settings.layout.contentSize', theme),
xl: tailpress.theme('settings.layout.wideSize', theme),
'2xl': '1440px',
'2xl': '1441px',
},
},
plugins: [tailpress.tailwind],

View File

@ -14,7 +14,7 @@ $thematiqueColorSlug = $mainThematique->slug;
<?php
$currentPage = get_post();
$parentPage = $currentPage->post_parent !== 0 ? get_post($currentPage->post_parent) : null;
$grandParentPage = $parentPage && $parentPage->post_parent ? get_post($parentPage->post_parent) : null;
$grandParentPage = $parentPage->post_parent ? get_post($parentPage->post_parent) : null;
?>
<ol>

View File

@ -1,7 +1,12 @@
<?php
// switch_to_blog(1);
$menu_name = 'renovateur';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object($locations[$menu_name]);
if ($menu->taxonomy !== 'nav_menu') die();
$menuitems = wp_get_nav_menu_items($menu->term_id, array('order' => 'DESC'));
$logoID = get_theme_mod('custom_logo');
$logoSRC = wp_get_attachment_image_src($logoID, 'full');
@ -153,7 +158,7 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full');
</div>
</a>
<?php else : ?>
<a href="<?php echo get_permalink($taxonomyRelatedPost->ID) ?>">
<a href="<?php echo "#" ?>">
<?php if ($cover) : ?>
<img class="sub-menu__navlist__thematique-icon" src="<?php echo $cover['icon']['url'] ?>" alt="">
<?php endif; ?>
@ -216,4 +221,8 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full');
// get_template_part('template-components/header/search-module');
?>
</div>
</div>
</div>
<?php
// restore_current_blog();
?>

View File

@ -1,4 +1,5 @@
<?php
// switch_to_blog(1);
$logoID = get_theme_mod('custom_logo');
$logoSRC = wp_get_attachment_image_src($logoID, 'full');
?>
@ -36,4 +37,9 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full');
<?php
// get_template_part('template-components/header/search-module');
?>
</nav>
</nav>
<?php
// restore_current_blog();
?>

View File

@ -1,5 +1,5 @@
<?php
switch_to_blog(1);
?>
<div id="search-module" class="search-module" mobile-closed aria-hidden role="search">
<div class="search-module__wrapper-container">
@ -16,7 +16,6 @@
$suggestions_posts = new WP_Query($args);
?>
<ul class="search-module__suggestions__navlist">
<?php foreach ($suggestions_posts->posts as $post) : ?>
<li class="suggestion-item">
<a href="<?php echo get_the_permalink($post->ID) ?>"><?php echo $post->post_title ?></a>
@ -26,4 +25,8 @@
</div>
</div>
</div>
</div>
<?php
restore_current_blog();
?>

View File

@ -75,6 +75,12 @@ $total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_pos
"pageIcon" => $pageIcon,
"title" => get_the_title(get_queried_object_id()),
"description" => __("Découvrez toutes nos publications et outils en ligne", "homegrade-theme__texte-fonctionnel"),
"ctaSecondary" => array(
"title" => $receivePrintedPublicationsDatas['cta_title'] ?? null,
"url" => $receivePrintedPublicationsDatas['order_form_url'] ?? null,
"target" => "_blank",
"custom-class" => "paper-button",
),
));
?>
@ -233,42 +239,15 @@ $total_posts_found = $brochuresPosts->found_posts + $fichesInfosPosts->found_pos
<!-- LOAD MORE -->
<button id="load-more-brochures" class="cta cta--button cta--outline cta--button cta--centered cta--load-more" data-publication-type="brochures"><?php echo __("Consulter plus de brochures", "homegrade-theme__texte-fonctionnel__publications-archive-brochures") ?></button>
<?php wp_reset_postdata(); ?>
<?php /* ---------
DISTRIBUEZ PUBLICATIONS
-----------------*/ ?>
<?php
$sharePublications = get_field('section_share_publications', $current_page_id);
?>
</section>
<?php
/* -------------------------
DISTRIBUEZ PUBLICATIONS
-----------------------------*/
?>
<?php
$receivePrintedPublicationsDatas['order_form_url'] ?? null
?>
<section class="distribuez-publications wp-block-homegrade-content-blocks-highlight homegrade-blocks-highlight homegrade-blocks-highlight--classic homegrade-blocks-highlight--has-illustration">
<div class="homegrade-blocks-highlight--has-illustration__content">
<div class="homegrade-blocks-highlight__titling ">
<div class="icon"><img decoding="async" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNi4wMTIiIGhlaWdodD0iMTUuOTk5IiB2aWV3Qm94PSIwIDAgMTYuMDEyIDE1Ljk5OSI+CiAgPGcgaWQ9Ikljb25fZmVhdGhlci1saW5rIiBkYXRhLW5hbWU9Ikljb24gZmVhdGhlci1saW5rIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMS45OTMgLTIuMDA3KSI+CiAgICA8cGF0aCBpZD0iVHJhY8OpXzE4NTU5IiBkYXRhLW5hbWU9IlRyYWPDqSAxODU1OSIgZD0iTTE1LDEwLjcwN2EzLjUsMy41LDAsMCwwLDUuMjguMzc4bDIuMS0yLjFBMy41LDMuNSwwLDEsMCwxNy40Myw0LjAzM2wtMS4yLDEuMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTYuNDAyIDApIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBpZD0iVHJhY8OpXzE4NTYwIiBkYXRhLW5hbWU9IlRyYWPDqSAxODU2MCIgZD0iTTExLjQsMTQuOWEzLjUsMy41LDAsMCwwLTUuMjgtLjM3OGwtMi4xLDIuMUEzLjUsMy41LDAsMSwwLDguOTcsMjEuNTdsMS4yLTEuMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNS41OSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8L2c+Cjwvc3ZnPgo=" alt=""></div>
<h3 class="homegrade-blocks-highlight__block-title"><?php echo $receivePrintedPublicationsDatas['title'] ?></h3>
</div>
<div class="homegrade-blocks-highlight__content__innerblocks">
<p><?php echo $receivePrintedPublicationsDatas['description'] ?></p>
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="<?php echo $receivePrintedPublicationsDatas['order_form_url'] ?>" target="_blank" rel="noreferrer noopener"><?php echo $receivePrintedPublicationsDatas['cta_title'] ?></a></div>
</div>
</div>
<img class="homegrade-blocks-highlight--has-illustration__illustration" decoding="async" src="<?php echo get_template_directory_uri() . "/resources/img/illustrations/homegrade_brochure-impression-domicile.svg" ?>" alt="">
</section>
<?php /* -----------
FICHES INFOS
------------------*/ ?>