Replace WooCommerce category images with plain text.

TIPS

Jun 7, 2022 | WooCommerce Tips | 0 comments

Sometimes it’s a pain to make images for all your WooCommerce product categories. Otherwise, you get the ugly default image. For example, see the image below where each category displays text only with a blue background.
Replace WooCommerce category images with plain text
Add the CSS below to hide the category image and style how you want the category names appear.
[css]
li.product-category a {
    padding-top:15px;
    padding-bottom:15px;
}
li.product-category {
    background-color:#002b91;
    width:265px;
    height:130px;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
}
li.product-category:hover {
    background-color:#1160d9;
    -moz-transition: all 0.2s; -webkit-transition: all 0.2s; transition: all 0.2s;
}
h2.woocommerce-loop-category__title {
    padding-left:10px !important;
    padding-right:10px !important;
    text-align:center;
    color:#fff;
    font-size:25px !important;
    line-height:35px;
}
[/css]

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

More Tips

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Ask the Divi Guy a Question

"*" indicates required fields