document.addEventListener("DOMContentLoaded", function () { const productList = document.querySelector("body.tax-product_cat ul.products"); if (!productList) return; // Function to enforce 2-column grid function enforceGridLayout() { productList.classList.remove("columns-1"); productList.style.display = "grid"; productList.style.gridTemplateColumns = "repeat(2, 1fr)"; productList.style.gap = "14px"; } // Run once on load enforceGridLayout(); // Watch for future mutations that re-add columns-1 const observer = new MutationObserver(function () { enforceGridLayout(); }); observer.observe(productList, { attributes: true, attributeFilter: [\"class\"] }); });
Skip to content