Skip to content

Instantly share code, notes, and snippets.

@stompweb
Created July 13, 2017 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stompweb/f162e829aea37dabbc87d20ef72cd304 to your computer and use it in GitHub Desktop.
Save stompweb/f162e829aea37dabbc87d20ef72cd304 to your computer and use it in GitHub Desktop.
Facet WP Category
<div class="row">
<div class="sort-by">
<div class="col-xs-7">
<div class="parent-link">
<?php
$current = get_queried_object();
$parent = get_term( $current->parent, $current->taxonomy ); ?>
<a href="<?php echo get_term_link( $parent ); ?>">
&larr; Back to all <?php echo esc_html( $parent->name ); ?>
</a>
</div>
</div>
<div class="col-xs-5">
<?php echo facetwp_display( 'sort' ); ?>
</div>
</div>
<div class="col-md-3 col-sm-4">
<div class="filters">
<span class="count">Currently showing <strong><?php echo facetwp_display( 'counts' ); ?></strong> upgrade parts.</span>
<a href="#" class="visible-xs filter-toggle">
<i class="fa fa-filter" aria-hidden="true"></i>
<span>Show</span> Filters
</a>
<div class="facets">
<br class="visible-xs">
<h3 class="widget-title">Colour</h3>
<?php echo facetwp_display( 'facet', 'colour' ); ?>
</div>
</div>
</div>
<div class="col-md-9 col-sm-8">
<div class="facetwp-template">
<?php woocommerce_product_loop_start(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/**
* woocommerce_shop_loop hook.
*
* @hooked WC_Structured_Data::generate_product_data() - 10
*/
do_action( 'woocommerce_shop_loop' );
?>
<?php wc_get_template_part( 'content', 'product' ); ?>
<?php endwhile; // end of the loop. ?>
<?php woocommerce_product_loop_end(); ?>
</div>
<?php echo facetwp_display( 'pager' ); ?>
</div>
</div>
@AVShurygin
Copy link

Filter by category??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment