Disable FacetWP submit by a condition

Disable facets on the frontpage, or any page by changing the condition. Is usefull when you want to filter on a different page.

add_action('wp_footer', 'facet_disable', 100);
function facet_disable(){
	if (is_front_page()) {
	?>
        <script>
            (function($) {
                $(function() {
                    if ('undefined' !== typeof FWP) {
                        FWP.auto_refresh = false;
						console.log('gedisabled')
                    }
                });
            })(fUtil);
        </script>
    <?php
	}

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest
Author picture

SitiWeb is de expert op het gebied van WordPress. gespecialiseerd in het leveren van maatwerk.

Leave a comment

Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *