yanknudtskov of YanCo ApS
7/6/2017 - 7:32 AM

Queryfix for WooCommerce Memberships and FacetWP

Queryfix for WooCommerce Memberships and FacetWP

<?php

/**
 * Queryfix for WooCommerce Memberships and FacetWP
 */

function yanco_facetwp_woocommerce_memberships_query_fix( $is_main_query, $query ) {
	if ( 'wc_user_membership' == $query->get( 'post_type' ) ) {
        $is_main_query = false;
    }

    return $is_main_query;
}
add_filter( 'facetwp_is_main_query', 'yanco_facetwp_woocommerce_memberships_query_fix', 10, 2 );