// Function to get query parameters from URL
function getQueryParam(param) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(param);
}
// Function to hide sections if it's not Page 1
function hideTopSectionsOnPagination() {
// Look for the specific pagination parameter (replace '5a0420bf_page' with your actual pagination parameter)
const currentPage = getQueryParam("5a0420bf_page");
console.log("Current page:", currentPage); // Debugging: check what page we're on
// Check if we're on Page 2 or greater (when currentPage is not null, it means we're on a paginated page)
if (currentPage && parseInt(currentPage, 10) > 1) {
console.log("Hiding top sections..."); // Debugging: if we're on page 2 or greater
// Hide the top sections (adjust the selector to match your sections)
const topSections = document.querySelectorAll(".top-section"); // Adjust this class if needed
console.log("Top sections found:", topSections.length); // Debugging: log how many sections are found
topSections.forEach(section => {
section.style.display = "none";
});
} else {
console.log("We're on Page 1. Top sections will not be hidden.");
}
}
// Run the function when the page loads
document.addEventListener("DOMContentLoaded", function() {
console.log("Page loaded, checking pagination...");
hideTopSectionsOnPagination();
});