PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Hide Search form on search results page

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi , i have created a search form using the shortcode [woof_text_filter] , and after i search something on it , the results page opens , but i dont want the results page to show the search form again and let the user keep searching.

The search form should disappear on the search results page and the user must click back button to keep searching again.

Hello

Here it is simple CSS solution for this!

When HUSKY performs a search (non-AJAX redirect), it automatically adds the class woof_search_is_going to the <body> tag on the results page. You can use this to hide the search form container.

Solution: Hide search form on results page using CSS

The search form container has the class .woof_text_search_container - we just need to hide it when the search is active.

Method 1: Add CSS via functions.php (Recommended)

Add this code to your child theme's functions.php file:

add_action('wp_footer', function() {
    ?>
    <style>
        body.woof_search_is_going .woof_text_search_container {
            display: none !important;
        }
    </style>
    <?php
});

Or using wp_head hook if you prefer:

add_action('wp_head', function() {
    ?>
    <style>
        body.woof_search_is_going .woof_text_search_container {
            display: none !important;
        }
    </style>
    <?php
});

Method 2: Add to your theme's style.css

If you have a child theme with style.css, you can add this CSS directly:

body.woof_search_is_going .woof_text_search_container {
    display: none !important;
}

How it works:

  1. User enters search on your main page → form is visible (no special body class yet)
  2. User submits search → page redirects to results
  3. On results page, <body> has class woof_search_is_going
  4. CSS rule kicks in and hides .woof_text_search_container
  5. User clicks browser back button → returns to original page without the body class → form appears again

Important notes:

  • Make sure you're using a child theme if adding to functions.php - otherwise updates will overwrite your changes
  • The !important flag ensures this CSS takes priority over other styles
  • This works for non-AJAX searches (with page reload/redirect)