0
votes

I have searched around but can't seem to find exactly what I am looking for. I have subcategories set up on my store, and images assigned to these subcategories, as I want the thumbnails to be displayed when you click into a main category Sub Categories Layout.

However, when I then click into the subcategory page, to display products within that subcategory, the image I set for the thumbnail appears under the description, quite large.

I don't want the subcategory image on the product list page whatsoever. Is there anything within the woocommerce code I can change or add to make this happen? This is what it looks like now... This I want it to look like this enter image description here

Thanks in advance!

1
Using CSS, you can just remove the photo with { display:none; }. Post the HTML for that image using a web inspector and I'll give you the proper selector.Jacob Raccuia
Ah! Perfect that worked, thank you so much!Jade Rotheram-Loddo
What CSS did you use to hide the image?Jacob Raccuia
I used the "woocommerce-layout.css" file, and changed codeimg{height:auto;max-width:100%;}code to codeimg{height:auto;max-width:100%;display:none;}codeJade Rotheram-Loddo
that didn't remove all of your images?Jacob Raccuia

1 Answers

0
votes

Using functions.php:

remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 );
add_action( 'woocommerce_before_subcategory_title', 'custom_subcategory_thumbnail', 10 );
function custom_subcategory_thumbnail( $category ) {
    if ( $category->parent == '0' ) {
        woocommerce_subcategory_thumbnail( $category );
    } else {
        // do not show a category image
    }
}

Using CSS:

.tax-product_cat ul.products li.product a img {
  display:none
}

Note: this code was found here.