Reputation: 611
I am trying to edit the layout of the shop page of my WooCommerce WordPress webshop.
Now in the WooCommerce settings I set it to disaply the categories. Now my goals is to change the <img />
tags into <div>
's. So I need to change the HTML. But I can't seem to find the template file that is used to create that page. I've looked in my theme folder and in the WooCommerce plugin folder.
Does anyone know where I can find the file or how to change the html output?
Many thanks in advance!
Upvotes: 1
Views: 10921
Reputation: 11
Considering this..
I wanna use a div with a fixed width and heigh and set a bg image so I can set it to cover because the images are all different dimensions
Try this, maybe will work. This will wrap the image with a div. Copy and paste it on functions.php of your theme.
// Add the img wrap
add_action( 'woocommerce_before_shop_loop_item_title', create_function('', 'echo "<div class=\"img-wrap\">";'), 5, 2);
add_action( 'woocommerce_before_shop_loop_item_title',create_function('', 'echo "</div>";'), 12, 2);
Upvotes: 1
Reputation: 1032
Check in this folder: wp-content/themes/your-theme-name/woocommerce/archive-product.php
If your theme is missing the woocommerce folder, then you can create on and past all (or only those you need to edit) template files and folders from wp-content/plugins/woocommerce/templates
to the wp-content/themes/your-theme-name/woocommerce/
Also it is a good practice to use child theme when you need to edit the theme of your site so you won't loose your edits when updating it.
Hope this would help.
Upvotes: 3