• Resolved dnweb

    (@dnweb)


    A query from WP GDPR Compliance plugin gets set as the main query, which interferes with the facetwp_is_main_query loop.

    This is breaking all FacetWP facets and templates from filtering posts and products.

    I’ve found a code that fixes it:

    
    /** WP GDPR Compliance breaks main_query fix
     ** Add to functions.php
     **/
    add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
        if ( '[wpgdprc_access_request_form]' == $query->get('s') ) {
            return false;
        }
        return $is_main_query;
    }, 10, 2);
    

    Code source by djrmom on github

    • This topic was modified 6 years, 1 month ago by dnweb.
Viewing 1 replies (of 1 total)
  • Premmerce WooCommerce Product Filter plugin also breaks if WP GDPR Compliance plugin is turned on. I suppose that this “main_query” issue could be blamed for this also. I tried other product filter plugins (e.g.: YITH WooCommerce Ajax Product Filter) and they are also broke. Could this problem be fixed in WP GDPR Plugin for all filter plugins, not just FacetWP?

Viewing 1 replies (of 1 total)
  • The topic ‘[SOLVED] Interfering with FacetWP’ is closed to new replies.