I want to change the position of the product title in archive-product page from below the thumbnail to the inside of the thumbnail.
i have a plugin telling me that the file responsible for this content is archive-product.php and inside i found the code
if ( woocommerce_product_loop() ) {
/**
* Hook: woocommerce_before_shop_loop.
*
* @hooked woocommerce_output_all_notices - 10
* @hooked woocommerce_result_count - 20
* @hooked woocommerce_catalog_ordering - 30
*/
do_action( 'woocommerce_before_shop_loop' );
woocommerce_product_loop_start();
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
/**
* Hook: woocommerce_shop_loop.
*
* @hooked WC_Structured_Data::generate_product_data() - 10
*/
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
}
}
woocommerce_product_loop_end();
What is the right way to style it as on the example ?
Any advice on what i am doing wrong will be hardly appreciated​
2
Answers
You have to override
archive-product.php
in your theme. For that, you have to create a woocommerce folder and place this template inside that folder by following the same folder structure of the woocommerce.After doing that place your custom code in that file. Add some custom class and apply CSS to it.
CSS version