Display "Nothing was found"

Forums › Forums › Search & Filter Pro › Display "Nothing was found"

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #20684

    Hello,

    I’m trying to display “Nothing was found” in my search and result template, but the last search cheched appears instead.

    Here the link for an error request : http://demo.pixovor.fr/liberty-auto/recherche-vehicule/?_sfm_marque=CITROEN&_sfm_prix=0+150000&_sfm_km=0+300000&_sfm_agence=Clermont-Ferrand&_sfm_vitesse=Bo%C3%AEte+automatique&sort_order=_sfm_prix+asc+num

    Here the code I use in my archive-template

    `<?php if ( have_posts() ) : ?>
    <div class=”container-fluid”>
    <div class=”col-lg-9″>
    <div class=”row”>
    <?php echo do_shortcode(‘[searchandfilter id=”7881887″]’); ?>
    </div>
    <div class=”row”><div class=”col-md-6″></div><div class=”col-md-6″></div>
    </div>
    <div id=”aff-vehicules” class=”row”>
    <div class=”row”>
    <div class=”col-md-6″>
    <p id=”nb-vehicule-result”><?php echo $wp_query->found_posts; ?> véhicules trouvés </p>
    </div>
    </div>
    <?php /* Start the Loop */
    while ( $wp_query->have_posts() ) : $wp_query->the_post();?>
    <?php /* Include the post format-specific template for the content. If you want to
    * this in a child theme then include a file called called content-___.php
    * (where ___ is the post format) and that will be used instead.
    */
    get_template_part( ‘content’, ‘annonces’, get_post_format() );

    endwhile;?>
    <div class=”pagination”><?php wp_pagenavi(); ?></div>
    </div>
    <?php else : ?>
    <div class=”row”>
    <article id=”post-0″ class=”post no-results not-found”>
    <header class=”entry-header”>
    <h1 class=”entry-title”><?php _e( ‘Nothing Found’, ‘twentytwelve’ ); ?></h1>
    </header>
    <div class=”entry-content”>
    <p><?php _e( ‘It seems we can’t find what you’re looking for. Perhaps searching can help.’, ‘twentytwelve’ ); ?></p>
    </div><!– .entry-content –>
    </article><!– #post-0 –>
    </div>
    </div>
    </div>
    <?php endif; ?>’

    Thanks

    Ross Moderator
    #21002

    Hey there

    I didn’t get a chance to go through your code, but if you refresh the page which should have no results you will see:

    http://demo.pixovor.fr/liberty-auto/recherche-vehicule/?_sfm_marque=CITROEN&_sfm_prix=88000+150000&_sfm_km=0+300000&_sfm_agence=Clermont-Ferrand&_sfm_vitesse=Bo%C3%AEte+automatique&sort_order=_sfm_prix+asc+num

    There is clearly some html errors which I think is causing you problems.

    Thanks

    Anonymous
    #21133

    Hello,
    I’ve clean-up my code and everything works.
    Thanks for your time

Viewing 3 posts – 1 through 3 (of 3 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.