I'm bootstrapping a woocommerce site and I am stuck. Below is my code in the content-product_cat.php
file
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<li <?php wc_product_cat_class( 'col-xs-12 col-sm-6 col-md-3' ); ?>>
<?php
/**
* woocommerce_before_subcategory hook.
*
* @hooked woocommerce_template_loop_category_link_open - 10
*/
do_action( 'woocommerce_before_subcategory', $category );
/**
* woocommerce_before_subcategory_title hook.
*
* @hooked woocommerce_subcategory_thumbnail - 10
*/
do_action( 'woocommerce_before_subcategory_title', $category );
/**
* woocommerce_shop_loop_subcategory_title hook.
*
* @hooked woocommerce_template_loop_category_title - 10
*/
do_action( 'woocommerce_shop_loop_subcategory_title', $category );
/**
* woocommerce_after_subcategory_title hook.
*/
do_action( 'woocommerce_after_subcategory_title', $category );
/**
* woocommerce_after_subcategory hook.
*
* @hooked woocommerce_template_loop_category_link_close - 10
*/
do_action( 'woocommerce_after_subcategory', $category ); ?>
</li>
This outputs like this:
<ul class="products">
<li class="col-xs-12 col-sm-6 col-md-3 product-category product first"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></li>
<li class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></li>
<li class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></li>
<li class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></li><li class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></li><li class="col-xs-12 col-sm-6 col-md-3 product-category product last"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></li>
...
<li class="col-xs-12 col-sm-6 col-md-3 product-category product first"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></li>
</ul>
The problem with this is if the images are not the same dimensions, the stacking gets interrupted. I need to be able to wrap it in this output:
<div class="products row">
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
</div>
<div class="products row">
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
</div>
...
<div class="products row">
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
<div class="col-xs-12 col-sm-6 col-md-3 product-category product"><a href="#"><img src="#"><h3>Category title <mark class="count">(1)</mark></h3></a></div>
</div>
Can anyone point me to the right direction? If you could help me out writing the code for me, I'll appreciate it immensely. I know it's better to learn than to have someone do it, but I literally have a ton of stuff to do in this site. I need to move fast.
Thanks a million