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

Viewing 9 posts - 1 through 9 (of 9 total)
  • 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 9 posts - 1 through 9 (of 9 total)