Navigation überspringen

[Gelöst] ?s site search not working

This support ticket is created vor 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 Antworten, hat 1 Stimme.

Zuletzt aktualisiert von tacoF vor 1 year, 3 months.

Assistiert von: Minesh.

Author
Artikel
#2797811

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

Link to a page where the issue can be seen: versteckter Link

After using the site search icon
versteckter Link

I get the expected results versteckter Link

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

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

My settings
versteckter Link

#2797917

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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":
=> versteckter Link

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.