Hi @lorro,
Thanks for the response.
I would think any change to your list of categories would break such a setup however it was coded.
What do you mean? Do you mean in terms of breaking the layout? That shouldn’t be a problem–I just need to make sure it’s only output every three items. If I can edit the PHP within the loop that won’t be a problem–I just need to add a variable containing the current category count and check ($i%3===0)
. E.g.
foreach ( $product_categories as $i=>$category ) {
wc_get_template(
'content-product_cat.php',
array(
'category' => $category,
)
);
if($i%3===0) {
// output sales ad
}
}
It’s just that I didn’t want to have to recreate the woocommerce_output_product_categories
function. I want this to be in the theme, so I think that’s the route I’ll have to take–though it does feel very messy.
Thanks for trying to help.
-
This reply was modified 4 years, 5 months ago by o0MSK0o.
-
This reply was modified 4 years, 5 months ago by o0MSK0o.