Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Forked from deckchairuk/facetwp-search-bug.php
Last active October 18, 2016 18:46
Show Gist options
  • Save mgibbs189/04b9ba0f78412cb2c72efdedcc4240e4 to your computer and use it in GitHub Desktop.
Save mgibbs189/04b9ba0f78412cb2c72efdedcc4240e4 to your computer and use it in GitHub Desktop.
<div class="category-navigation">
<div class="container vpadding--top vpadding--xs">
<div class="row">
<div class="col-xs-12">
<?php echo facetwp_display( 'facet', 'adaptation_levels' ); ?>
<?php echo facetwp_display( 'facet', 'search' ); ?>
</div>
</div>
</div>
</div> <!-- .category-navigation -->
<div class="product-listing">
<div class="container vpadding--lg">
<div class="row facetwp-template">
<?php $args = array(
'post_type'=> 'adaptations',
'facetwp' => true
);
$query = new WP_Query( $args ); ?>
<?php if ($query->have_posts()): ?>
<?php while($query->have_posts()) : $query->the_post(); ?>
<div class="col-xs-12 col-sm-6 col-md-4">
<?php get_template_part('modules/product', 'listing-item'); ?>
</div>
<?php endwhile ?>
<?php wp_reset_query(); ?>
<?php else: ?>
<div class="col-xs-12">
<div class="no-results">
<h2>Sorry, we couldn't find any adaptations based on your search</h2>
</div>
</div>
<?php endif ?>
</div>
</div>
</div> <!-- .product-listing -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment