Des haies ou clôtures en brande de bruyère rustique et naturelle. Des produits de qualité au bon prix!
// вставити в footer або у кастомний JS файл (або через Appearance → Customize → Additional JS)
(function(){
function replaceSearchTitle() {
const sel = document.querySelector('.elementor-widget-theme-archive-title .elementor-heading-title');
if (!sel) return;
// точне порівняння з початком рядка, без чутливості до регістру
const oldPrefix = 'Search Results for:';
const txt = sel.textContent.trim();
if (txt.startsWith(oldPrefix)) {
// отримуємо запит після префікса (якщо є)
const rest = txt.slice(oldPrefix.length).trim();
sel.textContent = rest ? `Résultats de recherche pour: ${rest}` : 'Résultats de recherche pour';
}
}
// Виклик одразу
replaceSearchTitle();
// Ставимо MutationObserver, на випадок якщо Elementor перерендерить блок
const observer = new MutationObserver(function(mutations) {
for (const m of mutations) {
if (m.type === 'childList' || m.type === 'characterData') {
replaceSearchTitle();
break;
}
}
});
// спостерігаємо за body (легко) — можна звузити scope за потреби
observer.observe(document.body, { childList: true, subtree: true });
})();