Hello @user250220231,
I understand you want to add some text below the product title on category pages.
You can add the text using the
woocommerce_after_shop_loop_item_title
hook and is_product_category()
conditional tag.
Example:
add_action( 'woocommerce_after_shop_loop_item_title', 'custom_product_category_test', 10 );
function custom_product_category_test() {
if ( is_product_category(uncategorized) ) {
echo '<div class="product-test">Your Test Here</div>';
}
}
To target certain categories, you can pass the category slug in is_product_category()
.
Example:
add_action( 'woocommerce_after_shop_loop_item_title', 'custom_product_category_test', 10 );
function custom_product_category_test() {
if ( is_product_category('clothes') ) {
echo '<div class="product-test">Your Test Here</div>';
}
}
Hope this helps! ??