hi there, I use facetwp. some of the facets didn't show up correctly. Facetwp support said there is some sort of view counter query that initially interferes with facet. They suggest I put below code into php file.
I do not want to add to the file itself. Is there a place I can place the code to fix the facet?
<?php
/** only detects queries that are set to facetwp=true explicitly **/ add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
if ( true !== $query->get( 'facetwp', false ) ) {
return false;
}
return $is_main_query;
}, 10, 2 );
see below for the detailed facet issue:
I noticed one of the facet didn't show up correctly on below page. Kitchen Tips, the check boxes of "collections" and "cooking tips" do not show up the first time when the page is rendered. Once the user has made a selection on the page, then both show up. Would you please advise why this happened and how to fix it? https://homenaturallymade.com/meal-plan/
hi there, I use facetwp. some of the facets didn't show up correctly. Facetwp support said there is some sort of view counter query that initially interferes with facet. They suggest I put below code into php file.
I do not want to add to the file itself. Is there a place I can place the code to fix the facet?
see below for the detailed facet issue:
I noticed one of the facet didn't show up correctly on below page. Kitchen Tips, the check boxes of "collections" and "cooking tips" do not show up the first time when the page is rendered. Once the user has made a selection on the page, then both show up. Would you please advise why this happened and how to fix it? https://homenaturallymade.com/meal-plan/
Thanks and Best Regards
Shirley
Hi,
You can add this code by installing the Code Snippet plugin, then creating a new snippet and putting all the custom PHP code in it.
Regards,
PenciDesign.
Perfect! Thank you so much.
Shirley