Archived topic
Adding text via hook on woocommerce category page
5 replies · Started by Andrew on April 4, 2022
I'm trying to add some custom text, preferably varying by category, but I'm struggling to find the required hook. I assume it's a hook I need?
I've added a link in the private information for an example - I'd like the text above the product links? Or below if above isn't possible.
Any pointers much appreciated!
Thanks.
Hi Andrew,
I think this is what you need ( visual hook guide for Woo pages):
https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/
You can use woocommerce_shop_loop_item_title hook, if the hook is not in the drop down list, then choosecustom hook, enter this hook name.
Thanks! That's done the trick.
One semi-related question when it comes to Elements: When should I use the Element type Block and when should I use Hook? Because it feels like as you can use hooks in Blocks there is no need to ever use the Hook element - Or is there?
When should I use the Element type Block and when should I use Hook?
In hook element, you can use JavaScript/PHP/CSS/HTML.
Block element is similar to hook element, but the content will be block based, not code based.
Hope I made it clear :)
Thanks - All clear :)
Great :)