Forums Forums Search & Filter Pro Hide result shortcode until user input (ajax auto update)

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #266624

    Hi there

    is it possible to hide the result shortcode (content) until the first user input ? or untill first returned results ?

    Thank’s in advance

    Trevor
    #266668

    Yes, you would need to edit the results.php file, as indicated here (changing the ID shown to match that of your form):

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(11690)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // the current resuts.php code here (ALL the code from the if ( $query->have_posts() ) line and onwards)
    }
Viewing 2 posts - 1 through 2 (of 2 total)