add_action('wp_footer', function() {

    if ( !is_post_type_archive('listing') && !is_tax('listing-category') && !is_tax('location') ) {
        return;
    }

    echo '<script>
(function() {

    function injectAds() {

        // Target all listing card containers
        var cards = document.querySelectorAll(".lp-grid-box-contianer");

        // Remove any previously injected ads to prevent duplicates on re-render
        var existing = document.querySelectorAll(".ws-infeed-ad");
        for (var r = 0; r < existing.length; r++) {
            existing[r].parentNode.removeChild(existing[r]);
        }

        var adCount = 0;

        for (var i = 0; i < cards.length; i++) {

            if ((i + 1) % 6 === 0) {

                adCount++;

                var adDiv = document.createElement("div");
                adDiv.className = "ws-infeed-ad";
                adDiv.style.cssText = "clear:both;width:100%;padding:16px 0;text-align:center;display:block;";

                var uniqueId = "ws-ad-" + adCount + "-" + Date.now();

                adDiv.innerHTML =
                    "<ins class=\"adsbygoogle\" " +
                    "style=\"display:block;width:100%;min-height:90px;\" " +
                    "data-ad-client=\"ca-pub-8831630778442397\" " +
                    "data-ad-slot=\"8714854721\" " +
                    "data-ad-format=\"auto\" " +
                    "data-full-width-responsive=\"true\" " +
                    "id=\"" + uniqueId + "\">" +
                    "</ins>";

                if (cards[i].parentNode) {
                    cards[i].parentNode.insertBefore(adDiv, cards[i].nextSibling);
                }

                if (window.adsbygoogle) {
                    try {
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    } catch(e) {}
                }
            }
        }
    }

    // Run on initial page load
    if (document.readyState === "loading") {
        document.addEventListener("DOMContentLoaded", injectAds);
    } else {
        injectAds();
    }

    // Watch for AJAX pagination - ListingPro reloads listing cards via AJAX
    var container = document.querySelector(".lp-archive-main, .lp-listing-loop-main, .row");
    if (container && window.MutationObserver) {
        var observer = new MutationObserver(function(mutations) {
            var hasNew = false;
            for (var m = 0; m < mutations.length; m++) {
                if (mutations[m].addedNodes.length > 0) {
                    hasNew = true;
                    break;
                }
            }
            if (hasNew) {
                setTimeout(injectAds, 600);
            }
        });
        observer.observe(container, { childList: true, subtree: true });
    }

    // Fallback for numbered pagination link clicks
    document.addEventListener("click", function(e) {
        var el = e.target;
        while (el && el !== document) {
            if (el.tagName === "A" && (
                el.closest(".pagination") ||
                el.closest(".page-numbers") ||
                el.closest(".lp-pagination") ||
                el.closest(".lp-load-more")
            )) {
                setTimeout(injectAds, 1200);
                break;
            }
            el = el.parentNode;
        }
    });

    // Catch browser back/forward navigation
    window.addEventListener("popstate", function() {
        setTimeout(injectAds, 800);
    });

})();
</script>';

}, 20);<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//wholesaleseeker.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://wholesaleseeker.com/page-sitemap.xml</loc>
		<lastmod>2026-05-29T14:46:39+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/listing-sitemap.xml</loc>
		<lastmod>2026-05-29T18:59:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/listing-sitemap2.xml</loc>
		<lastmod>2026-05-29T09:02:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/listing-sitemap3.xml</loc>
		<lastmod>2026-05-29T18:59:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/events-sitemap.xml</loc>
		<lastmod>2025-08-02T20:11:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/lp-reviews-sitemap.xml</loc>
		<lastmod>2026-05-29T08:57:36+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/listing-category-sitemap.xml</loc>
		<lastmod>2026-05-29T18:59:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/list-tags-sitemap.xml</loc>
		<lastmod>2026-05-21T04:57:42+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://wholesaleseeker.com/location-sitemap.xml</loc>
		<lastmod>2026-05-29T18:59:58+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->