Inserting things into category list
-
I’m not sure if this is the right place to ask for these sorts of questions, but I was wondering if anyone had any suggestions for a clean way to add things within the category list in the archive page.
My design looks like this: https://imgur.com/a/fb6NrMZ
It has a section within the category list advertising a sale. But I cannot think of a clean way to add that–displaying that isn’t a problem but displaying it *in the right place* is.
The category list is displayed through the
woocommerce_maybe_show_product_subcategories
function (hooked into thewoocommerce_product_loop_start
filter) which callswoocommerce_output_product_categories
to actually output the list.Since the loop for displaying categories is inside a function (as opposed to within a template) I’m not sure how I’d go about modifying it.
All I can think of is duplicating both functions and changing my
maybe_show_product_subcategories
function to use the duplicatedoutput_product_categories
function, then removing the original filter and adding my updated one.That feels very messy though, and like it might break something in a future update. Any suggestions for a clean way to change it?
- The topic ‘Inserting things into category list’ is closed to new replies.