Hello, I want to make a website. Today there is one problem I can not fix.
Whenever I hover over an image, there is text appears. I tried two methods.
1, add PHP code in functions.php file.
add_filter( ‘the_content’, ‘remove_images_title_attribute’ );
function remove_images_title_attribute( $text ) {
// Get all title attribute tags
$result = array();
preg_match_all( ‘|title=”[^”]*”|U’, $text, $result );
// Replace all title tags with an empty string
foreach ( $result[0] as $image_tag ) {
$text = str_replace( $image_tag, ”, $text );
}
return $text;
}
2, add this in style.css
.woocommerce ul.products li.product:hover .secondary-image, .woocommerce-page ul.products li.product:hover .secondary-image{ display: none !important; }
.product-button-hover { display: none !important; opacity: 0 !important; }
These two methods are not working. One thing I found weird is whenever I hover over the image the text is not the title of image.
Anyone could help me to solve this issue? Thanks!
[ad_2]