Forums Forums Search & Filter Pro Stop loading results on page load

  • This topic has 2 replies, 2 voices, and was last updated 6 years ago by Anonymous.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #191308

    I want only to show the results AFTER user clicks the submit button. Instead it shows results on page load. Is there a way to stop/prevent this?

    Using shortcode method on a template file. Loads results using Ajax.

    Trevor
    #191321

    As you are using the Shortcode results method, and our results.php template file (infinite scroll version), it would look like this:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1024)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // your template archive code/loop OR results.php code here
    }

    Change 1024 to the ID number of your form (from the form shortcode).

    Anonymous
    #191334

    Thank you! Code works fine.

Viewing 3 posts - 1 through 3 (of 3 total)