&lt;?php
/**
 * L&#039;Or des Plantes — Functions
 */

// 1. Enqueue styles
add_action(&#039;wp_enqueue_scripts&#039;, function() {
    wp_enqueue_style(&#039;lodp-style&#039;, get_stylesheet_uri(), array(&#039;generate-style&#039;), &#039;1.0.5&#039;);
});

// 2. Pas de sidebar nulle part
add_filter(&#039;generate_sidebar_layout&#039;, function() {
    return &#039;no-sidebar&#039;;
});
add_action(&#039;widgets_init&#039;, function() {
    unregister_widget(&#039;WP_Widget_Recent_Posts&#039;);
    unregister_widget(&#039;WP_Widget_Recent_Comments&#039;);
    unregister_widget(&#039;WP_Widget_Archives&#039;);
    unregister_widget(&#039;WP_Widget_Categories&#039;);
    unregister_widget(&#039;WP_Widget_Search&#039;);
}, 1);

// 3. Custom footer
remove_action(&#039;generate_footer&#039;, &#039;generate_construct_footer&#039;);
add_filter(&#039;generate_copyright&#039;, &#039;__return_empty_string&#039;);

add_action(&#039;generate_after_footer&#039;, function() {
    ?&gt;
&lt;footer class=&quot;lodp-footer&quot;&gt;
  &lt;div class=&quot;lodp-footer-grid&quot;&gt;
    &lt;div&gt;
      &lt;img src=&quot;&lt;?php echo get_stylesheet_directory_uri(); ?&gt;/logo.svg&quot; alt=&quot;L&#039;Or des Plantes&quot; style=&quot;height:36px;margin-bottom:12px&quot; onerror=&quot;this.style.display=&#039;none&#039;&quot;&gt;
      &lt;p style=&quot;color:var(--text-secondary);font-size:14px;line-height:1.6&quot;&gt;Herboristerie ambulante depuis 1980.&lt;br&gt;Atelier : Sauve (30610), Gard&lt;br&gt;Marchés du Gard &amp; Hérault&lt;/p&gt;
    &lt;/div&gt;
    &lt;div&gt;&lt;h4&gt;Navigation&lt;/h4&gt;&lt;a href=&quot;/&quot;&gt;Accueil&lt;/a&gt;&lt;a href=&quot;/boutique/&quot;&gt;Boutique&lt;/a&gt;&lt;a href=&quot;/histoire/&quot;&gt;Notre histoire&lt;/a&gt;&lt;a href=&quot;/contact/&quot;&gt;Contact&lt;/a&gt;&lt;/div&gt;
    &lt;div&gt;&lt;h4&gt;Catégories&lt;/h4&gt;&lt;a href=&quot;/categorie-produit/herboristerie-vrac-wcparticulier/&quot;&gt;Herboristerie&lt;/a&gt;&lt;a href=&quot;/categorie-produit/epices-wcparticulier/&quot;&gt;Épices&lt;/a&gt;&lt;a href=&quot;/categorie-produit/tisanes/&quot;&gt;Tisanes&lt;/a&gt;&lt;a href=&quot;/categorie-produit/cosmetiques/&quot;&gt;Cosmétiques&lt;/a&gt;&lt;/div&gt;
    &lt;div&gt;&lt;h4&gt;Infos&lt;/h4&gt;&lt;a href=&quot;/ou-nous-trouver/&quot;&gt;Où nous trouver&lt;/a&gt;&lt;a href=&quot;/contact/&quot;&gt;Contact&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;footer-bottom&quot;&gt;© &lt;?php echo date(&#039;Y&#039;); ?&gt; L&#039;Or des Plantes. Tous droits réservés.&lt;/div&gt;
&lt;/footer&gt;
    &lt;?php
});

// 4. Search overlay + JS
add_action(&#039;wp_footer&#039;, function() {
    ?&gt;
&lt;div class=&quot;lodp-search-overlay&quot; id=&quot;lodp-search-overlay&quot;&gt;
  &lt;button class=&quot;lodp-search-close&quot; id=&quot;lodp-search-close&quot; aria-label=&quot;Fermer&quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot;&gt;&lt;line x1=&quot;18&quot; y1=&quot;6&quot; x2=&quot;6&quot; y2=&quot;18&quot;/&gt;&lt;line x1=&quot;6&quot; y1=&quot;6&quot; x2=&quot;18&quot; y2=&quot;18&quot;/&gt;&lt;/svg&gt;&lt;/button&gt;
  &lt;div class=&quot;lodp-search-overlay-inner&quot;&gt;
    &lt;form role=&quot;search&quot; method=&quot;get&quot; action=&quot;&lt;?php echo esc_url(home_url(&#039;/&#039;)); ?&gt;&quot;&gt;
      &lt;input type=&quot;search&quot; name=&quot;s&quot; placeholder=&quot;Rechercher un produit...&quot; autocomplete=&quot;off&quot; id=&quot;lodp-search-input&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;post_type&quot; value=&quot;product&quot;&gt;
      &lt;button type=&quot;submit&quot; aria-label=&quot;Rechercher&quot;&gt;&lt;svg width=&quot;28&quot; height=&quot;28&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot;&gt;&lt;circle cx=&quot;11&quot; cy=&quot;11&quot; r=&quot;8&quot;/&gt;&lt;line x1=&quot;21&quot; y1=&quot;21&quot; x2=&quot;16.65&quot; y2=&quot;16.65&quot;/&gt;&lt;/svg&gt;&lt;/button&gt;
    &lt;/form&gt;
    &lt;div class=&quot;lodp-search-hint&quot;&gt;Entrée pour rechercher · Échap pour fermer&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;
document.addEventListener(&#039;DOMContentLoaded&#039;,function(){
  var t=document.getElementById(&#039;lodp-search-trigger&#039;),o=document.getElementById(&#039;lodp-search-overlay&#039;),c=document.getElementById(&#039;lodp-search-close&#039;),i=document.getElementById(&#039;lodp-search-input&#039;);
  if(t&amp;&amp;o){t.addEventListener(&#039;click&#039;,function(e){e.preventDefault();o.classList.add(&#039;open&#039;);setTimeout(function(){if(i)i.focus();},300);});}
  if(c&amp;&amp;o){c.addEventListener(&#039;click&#039;,function(){o.classList.remove(&#039;open&#039;);});o.addEventListener(&#039;click&#039;,function(e){if(e.target===o)o.classList.remove(&#039;open&#039;);});}
  document.addEventListener(&#039;keydown&#039;,function(e){if(e.key===&#039;Escape&#039;&amp;&amp;o&amp;&amp;o.classList.contains(&#039;open&#039;))o.classList.remove(&#039;open&#039;);});
  var h=document.querySelector(&#039;.lodp-hamburger&#039;),n=document.querySelector(&#039;.lodp-nav&#039;),ic=document.querySelector(&#039;.lodp-header-icons&#039;);
  if(h&amp;&amp;n){h.addEventListener(&#039;click&#039;,function(){this.classList.toggle(&#039;open&#039;);n.classList.toggle(&#039;open&#039;);if(ic)ic.classList.toggle(&#039;open&#039;);});}
});
&lt;/script&gt;
    &lt;?php
});

// 5. Exclure catégories techniques (sync Dolibarr)
add_filter(&#039;get_terms&#039;, function($terms, $taxonomy) {
    // $taxonomy can be array or string
    $taxes = is_array($taxonomy) ? $taxonomy : array($taxonomy);
    if (!in_array(&#039;product_cat&#039;, $taxes)) return $terms;
    $exclude = array(&#039;certification-bio&#039;,&#039;certification-bio-2&#039;,&#039;certification-bio-3&#039;,&#039;wcparticulier&#039;,&#039;wp-archive&#039;,&#039;non-classe-wcparticulier&#039;);
    return array_filter($terms, function($t) use ($exclude) {
        return !in_array($t-&gt;slug, $exclude);
    });
}, 10, 2);

// 6. Full width front page
add_filter(&#039;generate_container_class&#039;, function($classes) {
    if (is_front_page()) $classes[] = &#039;full-width&#039;;
    return $classes;
});

// 7. Assigner les templates aux pages
add_filter(&#039;template_include&#039;, function($template) {
    $templates = array(
        &#039;histoire&#039;   =&gt; &#039;page-histoire.php&#039;,
        &#039;contact&#039;    =&gt; &#039;page-contact.php&#039;,
        &#039;equipe&#039;     =&gt; &#039;page-equipe.php&#039;,
        &#039;ou-nous-trouver&#039; =&gt; &#039;page-trouver.php&#039;,
    );
    foreach ($templates as $slug =&gt; $file) {
        if (is_page($slug)) {
            $tpl = get_stylesheet_directory() . &#039;/&#039; . $file;
            if (file_exists($tpl)) return $tpl;
        }
    }
    return $template;
});

// 8. Supprimer les sideblogs restants
add_action(&#039;widgets_init&#039;, function() {
    unregister_widget(&#039;WP_Widget_Recent_Posts&#039;);
    unregister_widget(&#039;WP_Widget_Recent_Comments&#039;);
    unregister_widget(&#039;WP_Widget_Archives&#039;);
    unregister_widget(&#039;WP_Widget_Categories&#039;);
    unregister_widget(&#039;WP_Widget_Search&#039;);
}, 1);


    }
    return $html;
}, 10, 2);
    }
    return $html;
}, 10, 2);

// Affiche le badge Certification Bio
add_filter('woocommerce_product_get_image', function($html, $product) {
    if ($product && $product->get_meta('_certification_bio') === '1') {
        $badge = '<span class="lodp-bio-badge"></span>';
        $html = str_replace('<img', $badge . '<img', $html);
    }
    return $html;
}, 10, 2);
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//dev.ordesplantes.fr/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://dev.ordesplantes.fr/post-sitemap.xml</loc>
		<lastmod>2026-06-03T14:18:49+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.ordesplantes.fr/page-sitemap.xml</loc>
		<lastmod>2026-06-15T11:56:43+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.ordesplantes.fr/product-sitemap.xml</loc>
		<lastmod>2026-06-17T08:51:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.ordesplantes.fr/category-sitemap.xml</loc>
		<lastmod>2026-06-03T14:18:49+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.ordesplantes.fr/product_cat-sitemap.xml</loc>
		<lastmod>2026-06-17T08:51:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.ordesplantes.fr/product_tag-sitemap.xml</loc>
		<lastmod>2026-06-17T08:51:46+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://dev.ordesplantes.fr/author-sitemap.xml</loc>
		<lastmod>2026-06-15T17:49:50+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->