How to Fix and Customize the YITH Wishlist Heart Icon on Your WooCommerce Site
Content
One of the most common challenges users face with the YITH WooCommerce Wishlist plugin is getting the heart icon to display correctly. Whether it's not showing up at all, appearing in the wrong place, or not changing after a product is added, these issues can be frustrating. This guide compiles the most effective solutions from community discussions to help you troubleshoot and customize your wishlist icon.
Why Do These Icon Issues Happen?
Most display problems are not caused by bugs in the YITH WooCommerce Wishlist plugin itself. The primary culprits are:
- Theme Conflicts: Many popular themes, especially Flatsome, apply their own styles and customizations that override the plugin's default CSS. This can hide the icon, change its position, or alter its appearance.
- CSS Specificity: Your theme's stylesheet might use more specific CSS selectors, making the plugin's styles ineffective.
- JavaScript Interactions: For dynamic changes (like color updates after adding a product without a page reload), JavaScript is often required alongside CSS.
- Plugin Settings: The icon might simply be disabled in certain locations, like the shop loop, within the plugin's settings.
Common Solutions and Code Snippets
1. Make the Icon Always Visible (Not Just on Hover)
If your wishlist icon only appears when you hover over the product, this CSS can force it to be permanently visible.
.product .image-tools.is-small {
opacity: 1;
}
Add this code in your WordPress dashboard under Appearance > Customize > Additional CSS.
2. Reposition the Icon on Product Images
To move the icon from the default top-left position to another corner, use CSS positioning. The following code moves it to the top-right.
.add-to-wishlist-before_image .yith-wcwl-add-to-wishlist {
left: auto !important;
right: 10px !important;
}
You can modify the top, bottom, left, and right values to achieve the exact placement you need.
3. Fix Icon Display in Flatsome Theme
Flatsome is a common source of conflicts. If the above CSS doesn't work, you may need to enqueue the plugin's assets with this PHP code snippet. Add it to your child theme's functions.php file.
if ( defined( 'YITH_WCWL' )) {
if( ! function_exists( 'yith_wcwl_enqueue_back_required_assets' ) ) {
function yith_wcwl_enqueue_back_required_assets() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script( 'yith-wcwl-frontend', YITH_WCWL_URL . 'assets/js/frontend/wishlist' . $suffix . '.js', array( 'jquery' ), YITH_WCWL_VERSION, true );
}
add_action( 'wp_enqueue_scripts', 'yith_wcwl_enqueue_back_required_assets', 20 );
}
}
4. Enable the Icon on Shop and Archive Pages
Before trying any code, first check the plugin's settings. Navigate to YITH > Wishlist > Add to Wishlist Options > Loop Settings. Ensure the "Show Add to wishlist button" option is enabled and choose your preferred position from the dropdown.
5. Change the Icon's Appearance (Size, Color, Background)
You can use CSS to style the icon to match your site's design. This example reduces the size, changes the color to red, and removes the circular background.
.yith-wcwl-add-to-wishlist i {
font-size: 1.2rem;
color: red;
background-color: transparent !important;
border: none !important;
}
Important Considerations
- Use a Child Theme: Always add custom code to a child theme's
style.cssorfunctions.phpfile. This prevents your changes from being overwritten during theme updates. - Clear Your Cache: After making CSS changes, clear any caching plugins or server-side caches to see the results immediately.
- Test with a Default Theme: If problems persist, temporarily switch to a default WordPress theme like Twenty Twenty-Four. If the icon works there, the issue is definitively a conflict with your main theme, and you may need to contact its support for further assistance.
By following these steps, you should be able to gain control over the appearance and placement of your YITH wishlist heart icon, creating a seamless experience for your customers.
Related Support Threads Support
-
Add wishlist heart icon to header using Elementorhttps://wordpress.org/support/topic/add-wishlist-heart-icon-to-header-using-elementor/
-
Add to wishlist heart icon visible on category pagehttps://wordpress.org/support/topic/add-to-wishlist-heart-icon-visible-on-category-page/
-
link to wishlist with icon hearthttps://wordpress.org/support/topic/link-to-wishlist-with-icon-heart/
-
Wishlist single product page remove iconhttps://wordpress.org/support/topic/wishlist-single-product-page-remove-icon/
-
Show Icon Always on Product Pagehttps://wordpress.org/support/topic/show-icon-always-on-product-page/
-
Wishlist Icon Hover Visibilityhttps://wordpress.org/support/topic/wishlist-icon-hover-visibility/
-
Add to wishlist Icons in Flatsomehttps://wordpress.org/support/topic/add-to-wishlist-icons-in-flatsome/
-
collegare l’ icona whishlist alla paginalista desiderihttps://wordpress.org/support/topic/collegare-l-icona-whishlist-alla-paginalista-desideri/
-
Cannot change Wishlist icon from Heart Ohttps://wordpress.org/support/topic/cannot-change-wishlist-icon-from-heart-o/
-
change colour of icon for liked itemshttps://wordpress.org/support/topic/change-colour-of-icon-for-liked-items/
-
Add To wishlist on product pagehttps://wordpress.org/support/topic/add-to-wishlist-on-product-page-2/
-
How to add a wishlist icon in header with count, dropdown with included productshttps://wordpress.org/support/topic/how-to-add-a-wishlist-icon-in-header-with-count-dropdown-with-included-products/
-
Creating a Hover Effect with Wishlist Icon Over Imageshttps://wordpress.org/support/topic/creating-a-hover-effect-with-wishlist-icon-over-images/
-
Add to wishlist text – only on single-product page?https://wordpress.org/support/topic/add-to-wishlist-text-only-on-single-product-page/
-
how to check the product on the wish listhttps://wordpress.org/support/topic/how-to-check-the-product-on-the-wish-list/
-
Move “Add to wishlist” icons to the bottom of products imageshttps://wordpress.org/support/topic/move-add-to-wishlist-icons-to-the-bottom-of-products-images/
-
How to add the Heart icon to headerhttps://wordpress.org/support/topic/how-to-add-the-heart-icon-to-header/
-
Add option to align the wishlist button to left/right.https://wordpress.org/support/topic/add-option-to-align-the-wishlist-button-to-left-right/
-
Float icon right over imagehttps://wordpress.org/support/topic/float-icon-right-over-image/
-
Icon after wish-listed is a checkmarkhttps://wordpress.org/support/topic/icon-after-wish-listed-is-a-checkmark/
-
Place wishlist icon in product image on product pagehttps://wordpress.org/support/topic/place-wishlist-icon-in-product-image-on-product-page/
-
Wishlist icon on Shop page.https://wordpress.org/support/topic/wishlist-icon-on-shop-page/
-
add title to whishlist iconhttps://wordpress.org/support/topic/add-title-to-whishlist-icon-2/
-
Added to wishlist shows no iconhttps://wordpress.org/support/topic/added-to-wishlist-shows-no-icon/
-
how to show the heart iconhttps://wordpress.org/support/topic/how-to-show-the-heart-icon/
-
Facebook Custom Conversionhttps://wordpress.org/support/topic/facebook-custom-conversion/
-
Edit Add to Wishlist Iconhttps://wordpress.org/support/topic/edit-add-to-wishlist-icon/
-
Add to wishlist writtenhttps://wordpress.org/support/topic/add-to-wishlist-written/
-
Placing the wishlist icon to the right corner of the producthttps://wordpress.org/support/topic/placing-the-wishlist-icon-to-the-right-corner-of-the-product/
-
How to show icon when no items in wishlist.https://wordpress.org/support/topic/how-to-show-icon-when-no-items-in-wishlist/
-
Browse wishlist above images on related productshttps://wordpress.org/support/topic/browse-wishlist-above-images-on-related-products/