"No Results" – Response

Forums › Forums › Search & Filter Pro › "No Results" – Response

Viewing 10 posts – 1 through 10 (of 10 total)
  • Anonymous
    #158554

    Hi,

    we are using search filter pro on an category-archive page. Everything works fine except one thing: When no results are matching the given filters, it is loading for an eternity and the ajax-response is empty. Nothing changes on the former results, no message that says that there are no results matching the criteria appears.

    Could you provide us some help?

    Best regards
    Adrian

    Trevor
    #158555

    Are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #158564
    Trevor
    #158573

    Hi

    I can see that you are using the ‘As an Archive’ method, which relies on your theme template file, which you will have specified.

    As the Ajax refresh is looking for a container with the ID of article_container, the template must have its ‘No Results Found` message inside a same named container, which means you would have to edit the template file. To do that safely, you must be working with a child theme and have the edited file in the child theme folder.

    Anonymous
    #158577
    This reply has been marked as private.
    Trevor
    #158579

    You are opening the Ajax container outside the start of the IF:

    echo '<div id="article_container">';
    if (have_posts()) { ?>

    But then you end it INSIDE the IF and echo the HTML content there:

    }// end while
    $html_content .='</div>'; //article-container
    echo $html_content; ?>
    
    <?php } else { ?>
    <!– Why we never come here?! –>
    <?php echo 'no-results'; ?>
    <?php } // endif; ?>

    Instead try this (but keep a copy of your code):

    }// end while
    
    <?php } else { ?>
    <!– Why we never come here?! –>
    <?php $html_content = 'no-results'; ?>
    <?php } // endif; ?>
    $html_content .='</div>'; //article-container
    echo $html_content; ?>

    And, strictly speaking, this line:

    echo '<div id="article_container">';
    

    Should be:

    $html_content = '<div id="article_container">';
    

    I think.

    Anonymous
    #158590
    This reply has been marked as private.
    Trevor
    #158593

    I wonder. You are constructing the html before you output the form and ajax container, but that part does not get output again.

    Instead of adding each part to the $html_content string, why not echo it directly?

    Anonymous
    #158597
    This reply has been marked as private.
    Trevor
    #158603
    This reply has been marked as private.
Viewing 10 posts – 1 through 10 (of 10 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.