Passer la navigation

[Résolu] ?s site search not working

This support ticket is created Il y a 1 year, 3 months. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 1 réponses, a 1 voix.

Dernière mise à jour par tacoF Il y a 1 year, 3 months.

Assisté par: Minesh.

Auteur
Publications
#2797811

I am trying to: perform a site search and display results

Link to a page where the issue can be seen: lien caché

After using the site search icon
lien caché

I get the expected results lien caché

But then I enter a new keyword, for example "swing" lien caché
and the results remain the same because in the URL it shows as lien caché

the "s" URL param hasn't changed. How do I fix this?

My settings
lien caché

#2797917

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - default search and Toolset text search is bit different. It will not update the default "s" URL param directly.

Can you please send me admin access details and let me check what workaround I can offer.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2798045

Hello, you are working on a LIVE website, I just wanted to let you know as I just saw the output of debugging for a while.

#2798046

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

I've added the following code with "Custom Code" section offered by Toolset with the code snippet namely "adjust-search-url-param":
=> lien caché

function func_update_default_search_value($query) {
    if ( ! is_admin()  ) {
     global $WP_Views;
  
    if($query->is_search and isset($_GET['wpv_post_search'])){
      $query->set("s",$_GET['wpv_post_search']);
    }
       
    }
}
add_action( 'pre_get_posts', 'func_update_default_search_value', 999, 1 );

Can you please confirm it works as expected now.

#2798601

Thank you very much. It appears to be working.