(function() {
function purgeStray() {
try {
var walker = document.createTreeWalker(document.documentElement, NodeFilter.SHOW_TEXT, null, false);
while (walker.nextNode()) {
if (walker.currentNode.nodeValue && walker.currentNode.nodeValue.indexOf(“Disable wpautop”) !== -1) {
walker.currentNode.nodeValue = “”;
}
}
} catch(e) {}
}
purgeStray();
document.addEventListener(“DOMContentLoaded”, purgeStray);
window.addEventListener(“load”, purgeStray);
})();

(function() {
// A. PURGE STRAY CODE (Issue 3)
function purgeStray() {
try {
var walker = document.createTreeWalker(document.documentElement, NodeFilter.SHOW_TEXT, null, false);
while (walker.nextNode()) {
if (walker.currentNode.nodeValue && walker.currentNode.nodeValue.indexOf(“Disable wpautop”) !== -1) {
walker.currentNode.nodeValue = “”;
}
}
} catch(e) {}
}
purgeStray();
document.addEventListener(“DOMContentLoaded”, purgeStray);
window.addEventListener(“load”, purgeStray);
setInterval(purgeStray, 250);

// B. REWRITE CATEGORY LINKS IN MENUS & FOOTER TO DEDICATED PAGES (Issue 4)
function rewriteCategoryLinks() {
var map = {
“/product-category/randa/”: “/randa/”,
“/product-category/kaftan/”: “/kaftan/”,
“/product-category/takchita/”: “/takchita/”,
“/product-category/djellaba/”: “/djellaba/”
};
var links = document.querySelectorAll(“a[href*=’/product-category/’]”);
links.forEach(function(a) {
var href = a.getAttribute(“href”) || “”;
for (var oldSlug in map) {
if (href.indexOf(oldSlug) !== -1 || href.endsWith(oldSlug.slice(0, -1))) {
a.setAttribute(“href”, map[oldSlug]);
}
}
});
}

if (document.readyState === “loading”) {
document.addEventListener(“DOMContentLoaded”, rewriteCategoryLinks);
} else {
rewriteCategoryLinks();
}
window.addEventListener(“load”, rewriteCategoryLinks);
setInterval(rewriteCategoryLinks, 500);
})();

عرض ⁦8⁩ من كل النتائج