When I use transposh plugin get_query_var('s') returns me blank. But I can get value of s by using $_GET[‘s’]. So, my search functionality has been stopped. How can I resolve this issue?

1 Answer
1

Probably you need to use the following function somewhere in your template, whether in functions.php or somewhere.

function add_query_vars_filter( $vars ){
  $vars[] = "s";
  return $vars;
}
add_filter( 'query_vars', 'add_query_vars_filter' );

It’ll avail your s parameter from the URL into the get_query_var('s').

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *