Skip to content
Public Ticket #19470

php code

Conversation thread

shirleydt replied

Customer Reply

Perfect!  Thank you so much.

Shirley

PenciDesign Supporter replied

Staff Reply

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.


shirleydt started the conversation

Conversation Start

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/

Thanks and Best Regards

Shirley


Want to join this conversation or access attachments? Sign in first.