Forums › Forums › Search & Filter Pro › Display 'no results found'
- This topic has 2 replies, 2 voices, and was last updated 7 years, 5 months ago by
Anonymous.
-
Anonymous(Private) September 12, 2017 at 9:24 pm #130718
Hi there,
I have an archive page with two checkbox filters that have an AND relationship. The filter works fine although I am having trouble displaying a ‘no posts found’ message when the filter criteria returns no posts.
Thanks,
BradenMy code:
<div class=”row”>
<div class=”col-xl-3 col-lg-12 left-sidebar adjust-space”>
<div class=”filter-wrapper”>
<div class=”button-filter”>
<?php echo do_shortcode(‘[searchandfilter id=”43″]’); ?>
</div>
</div>
</div>
<div class=”col-xl-9 col-lg-12 bg-white”>
<div class=”featured-section”>
<div class=”container-fluid no-padding”>
<div id=”filter-results” class=”row”><?php
$args = array(‘post_type’ => ‘clients’);
$args[‘search_filter_id’] = 43;
$query = new WP_Query( $args );
?><?php if ( have_posts( $query->have_posts() ) ) : ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<div class=”col-lg-3 col-md-4 col-sm-6 col-xs-12 item”>
<?php
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( ‘loop-templates/content-featured-tile’, get_post_format() );
?></div>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( ‘loop-templates/content-none’, get_post_format() ); ?>
<?php endif; wp_reset_postdata(); ?>
</div>
</div>
</div>
</div>
</div> -
AuthorPosts