This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Remove from facebook pixel

#33107
sumaiya91sumaiya91
Participant

Ok then help me another way. I have changed the name of the default query string to “search” from “s”. But using the below code snippet

//Remove the default search var and add a custom one
add_filter(‘init’, function(){
global $wp;
$wp->add_query_var( ‘search’ );
$wp->remove_query_var( ‘s’ );
} );

//If the custom var is passed copy that over to the default “s” var
add_filter( ‘request’, function( $request ){
if( isset( $_REQUEST[‘search’] ) ){
$request[‘s’] = $_REQUEST[‘search’];
}
return $request;
} );

So the site works with https://newbook.therastore.co.nz/?search=collagen rather then https://newbook.therastore.co.nz/?s=collagen

But now your plugin is still referring back to “s” is not working when the “search” button is clicked. How do i update the input box so it uses “search” rather than “s” variable.