Archived topic
Move product title above product image on Woocommerce
3 replies · Started by FunkyCss on January 2, 2020
Hi , i want to move the product title above image on my products but i want to display this on a specific pages like archive .
i have used this code on functions
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 11 );
but this also displays in related products that i dont want ! is any recomendation to set this u p?
Hi there,
you can try using this function to create a conditional wrap around your remove / add actions:
add_action( 'wp', function() {
if ( is_shop() || is_product_category() ) {
// Remove - Add actions go here
}
} );
Hallo David just now i checked about conditional tag etc and is so many good things i can do ! thank you it works really good !
Glad to be of help