<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WPWife &#187; fade image effect</title>
	<atom:link href="http://www.wpwife.com/category/fade-image-effect/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpwife.com</link>
	<description>WPHelp: fix and optimise WP themes&#38;plugins</description>
	<lastBuildDate>Fri, 21 Nov 2025 12:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.38</generator>
	<item>
		<title>How to Fade Images on Mouseover in WordPress (Simple &amp; Easy)</title>
		<link>http://www.wpwife.com/themes/how-to-fade-images-on-mouseover-in-wordpress-simple-easy</link>
		<comments>http://www.wpwife.com/themes/how-to-fade-images-on-mouseover-in-wordpress-simple-easy#comments</comments>
		<pubDate>Tue, 28 Mar 2023 07:40:00 +0000</pubDate>
		<dc:creator><![CDATA[Editorial Staff]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[fade image effect]]></category>
		<category><![CDATA[fade image on mouseover]]></category>
		<category><![CDATA[image hover effect]]></category>
		<category><![CDATA[seedprod]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[wpcode]]></category>

		<guid isPermaLink="false">http://www.wpbeginner.com/?p=19555</guid>
		<description><![CDATA[
<p>Do you want to fade images on mouseover in WordPress? A simple fade-in or fade-out animation when a user moves their mouse over an image can make your site more engaging. It also encourages visitors to interact with your content, which can keep them on&#8230;&#160;<strong><a href="https://www.wpbeginner.com/wp-themes/fade-images-mouseover-wordpress/">Read More &#187;</a></strong></p>
<p>The post <a href="https://www.wpbeginner.com/wp-themes/fade-images-mouseover-wordpress/">How to Fade Images on Mouseover in WordPress (Simple &#38; Easy)</a> first appeared on <a href="https://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Do you want to fade images on mouseover in WordPress?</p>



<p>A simple fade-in or fade-out animation when a user moves their mouse over an image can make your site more engaging. It also encourages visitors to interact with your content, which can keep them on your site for longer. </p>



<p>In this article, we’ll show you how to add a fade image effect on mouseover in WordPress.</p>



<figure class="wp-block-image size-full"><img width="680" height="385" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-images-on-mouseover-in-wordpress-og.png" alt="How to fade images on mouseover in WordPress" class="wp-image-171343" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-images-on-mouseover-in-wordpress-og.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-images-on-mouseover-in-wordpress-og-300x170.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<h4>Why Fade Images on Mouseover in WordPress?</h4>



<p>Animations are an easy way to make your website more interesting, and can even draw the visitor&#8217;s attention toward your page&#8217;s most important content, such as your <a href="https://www.wpbeginner.com/beginners-guide/how-to-make-a-logo-for-your-website-simple-guide-for-beginners/" title="How to Make a Logo for Your Website (Simple Guide for Beginners)">website logo</a> or a <a href="https://www.wpbeginner.com/plugins/how-to-add-buttons-in-wordpress-without-using-shortcodes/" title="How to Add Call to Action Buttons in WordPress (without Code)">call to action</a>.</p>



<p>There are lots of different ways to <a href="https://www.wpbeginner.com/plugins/how-to-easily-add-css-animations-in-wordpress/" title="How to Easily Add CSS Animations in WordPress">use CSS animations in WordPress</a>, but adding a hover effect to images is particularly effective. The fade animation means your images will slowly appear or disappear when visitors hover over them. </p>



<figure class="wp-block-image size-full"><img width="600" height="316" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-animation-wordpress.gif" alt="Adding a fade animation to WordPress" class="wp-image-171410"/></figure>



<p>This encourages people to interact with your images, and can even add a storytelling element to the page. For example, different images might fade in and out as the visitor moves around the page.</p>



<p>Unlike some other animations, the fade image on mouseover effect is subtle so it won’t negatively impact the visitor’s reading experience or any <a title="How to Optimize Images for Web Performance without Losing Quality" href="https://www.wpbeginner.com/beginners-guide/speed-wordpress-save-images-optimized-web/">image optimization</a> you&#8217;ve done.</p>



<p>With that said, let’s show you how to add a fade to your images on mouseover in WordPress.</p>



<h4>Adding Image Fade on Mouseover to all WordPress Images</h4>



<p>The easiest way to add a fade effect to all your images is by using <a href="https://wpcode.com/"  title="WPCode - WordPress Code Snippet Plugin" rel="noopener">WPCode</a>. This free plugin allows you to <a href="https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/" title="How to Easily Add Custom Code in WordPress (Without Breaking Your Site)">easily add custom code in WordPress</a> without having to edit your theme files. </p>



<p>With WPCode, even beginners can edit their website’s code without risking mistakes and typos that can cause many&nbsp;<a href="https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/" title="Most Common WordPress Errors and How to Fix Them">common WordPress errors</a>.</p>



<p>The first thing you need to do is install and activate the <a href="https://wordpress.org/plugins/insert-headers-and-footers"  title="WPCode Free Code Snippet Plugin for WordPress" rel="noopener">free WPCode plugin</a>. For more details, see our step-by-step guide on&nbsp;<a href="https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/" title="How to Install a WordPress Plugin – Step by Step for Beginners">how to install a WordPress plugin</a>.</p>



<p>Upon activation, head over to&nbsp;<strong>Code Snippets » Add Snippet</strong>.</p>



<figure class="wp-block-image size-full"><img width="680" height="327" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/adding-code-wpcode.png" alt="Adding custom code to your WordPress website with WPCode" class="wp-image-171338" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/adding-code-wpcode.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/adding-code-wpcode-300x144.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Here, simply hover your mouse over ‘Add Your Custom Code.’</p>



<p>When it appears, click on ‘Use snippet.’</p>



<figure class="wp-block-image size-full"><img width="680" height="380" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/creating-new-snippet.png" alt="Creating a custom CSS snippet on your WordPress website" class="wp-image-171339" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/creating-new-snippet.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/creating-new-snippet-300x168.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>To start, type in a title for the custom code snippet. This can be anything that helps you identify the snippet in the WordPress dashboard.</p>



<p>We need to <a title="How to Easily Add Custom CSS to Your WordPress Site" href="https://www.wpbeginner.com/plugins/how-to-easily-add-custom-css-to-your-wordpress-site/">add custom CSS to WordPress</a>, so open the &#8216;Code Type&#8217; dropdown and select &#8216;CSS Snippet.&#8217; </p>



<figure class="wp-block-image size-full"><img width="680" height="327" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/css-snippet-fade-.png" alt="Add a fade on mouseover animation to images using WPCode" class="wp-image-171370" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/css-snippet-fade-.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/css-snippet-fade--300x144.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>In the code editor, add the following code snippet:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: css; title: ; notranslate">
.post img:hover{
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
-webkit-transition: all 2s ease;
-moz-transition: all 2s ease;
-ms-transition: all 2s ease;
-o-transition: all 2s ease;
transition: all 2s ease;
}
</pre></div>


<p>This code snippet will fade each image for 2 seconds when the user hovers their mouse over it. To make the image fade slower, simply replace ‘2s ease’ with a higher number. If you want to make the picture fade faster, then use &#8216;1s ease&#8217; or smaller. </p>



<p>You can also make the ‘opacity’ higher or lower by changing the <code>opacity:0.6</code> line. </p>



<p>If you change any of these numbers then make sure you change them across all the properties (webkit, moz, ms, and o), so the fade effect looks the same on every browser. </p>



<p>When you’re happy with the snippet, scroll to the ‘Insertion’ section. WPCode can add your code to different locations, such as after every post, frontend only, or admin only.</p>



<p>To add a fade effect to all your images, click on ‘Auto Insert.&#8217; Then, open the ‘Location’ dropdown menu and choose ‘Site Wide Header.’</p>



<figure class="wp-block-image size-full"><img width="680" height="301" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/auto-insert-css.png" alt="Inserting custom CSS across your WordPress website" class="wp-image-171342" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/auto-insert-css.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/auto-insert-css-300x133.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>After that, you’re ready to scroll to the top of the screen and click on the ‘Inactive’ toggle, so it changes to ‘Active.’</p>



<p>Finally, click on ‘Save Snippet’ to make the CSS snippet live.</p>



<figure class="wp-block-image size-full"><img width="680" height="378" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/saving-fade-animation.png" alt="Adding a fade effect to images using CSS" class="wp-image-171371" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/saving-fade-animation.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/saving-fade-animation-300x167.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Now, if you hover the mouse over any image on your <a href="https://www.wpbeginner.com/guides/" title="How to Make a WordPress Website (Ultimate Guide)">WordPress website</a>, you&#8217;ll see the fade effect in action. </p>



<h4>Adding Image Fade Animations to Individual Pages</h4>



<p>Using a fade effect for every single image can become distracting, especially if you&#8217;re running a <a href="https://www.wpbeginner.com/showcase/best-free-wordpress-photography-themes/" title="Best Free WordPress Photography Themes (Expert Pick)">photography website</a>, a stock photo store, or any other site that has lots of images. </p>



<p>With that in mind, you may want to use fade effects on a specific page or post only. </p>



<p>The good news is that WPCode allows you to create custom shortcodes. You can place this shortcode on any page, and WordPress will show fade effects on that page only. </p>



<p>To do this, simply create a custom code snippet and add the fade animation code following the same process described above. Then, click on the &#8216;Save snippet&#8217; button.</p>



<figure class="wp-block-image size-full"><img width="680" height="373" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/saving-fade-animations.png" alt="Fade images on mouseover in WordPress using custom code" class="wp-image-171372" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/saving-fade-animations.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/saving-fade-animations-300x165.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>After that, scroll to the &#8216;Insertion&#8217; section, but this time select &#8216;Shortcode.&#8217; </p>



<p>This creates a shortcode that you can add to any page, post, or widget-ready area.</p>



<figure class="wp-block-image size-full"><img width="680" height="333" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/wpcode-creating-shortcode.png" alt="Creating a shortcode in WPCode" class="wp-image-171373" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/wpcode-creating-shortcode.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/wpcode-creating-shortcode-300x147.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>After that, go ahead and make the snippet live following the same process described above.</p>



<p>You can now go to any page, post, or widget-ready area and create a new &#8216;Shortcode&#8217; block. Then, simply paste the WPCode shortcode into that block.</p>



<figure class="wp-block-image size-full"><img width="680" height="280" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-animation-shortcode.png" alt="How to create fade animations for images using shortcode" class="wp-image-171375" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-animation-shortcode.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-animation-shortcode-300x124.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>For more information on how to place the shortcode, please see our guide on <a href="https://www.wpbeginner.com/wp-tutorials/how-to-add-a-shortcode-in-wordpress/" title="How to Add a Shortcode in WordPress (Beginner’s Guide)">how to add a shortcode in WordPress</a>. </p>



<p>With that done, either click on the &#8216;Update&#8217; or &#8216;Publish&#8217; button to make the shortcode live. You can then visit that page, page, or widget-ready area to see the fade on mouseover effect. </p>



<h4>Adding Image Fade Animations to <strong>Featured Images</strong></h4>



<p>Another option is to add fade animations to your <a title="How to Add Featured Images or Post Thumbnails in WordPress" href="https://www.wpbeginner.com/beginners-guide/how-to-add-featured-image-or-post-thumbnails-in-wordpress/">featured images or post thumbnails</a>. These are the post&#8217;s primary image and they often appear next to the heading on your home page, <a href="https://www.wpbeginner.com/wp-tutorials/how-to-create-an-archives-page-in-wordpress/" title="How to Create a Custom Archives Page in WordPress">archive pages</a>, and other important areas of your website.</p>



<p>By fading featured images on mouseover, you can make your site more eye-catching and engaging, without animating every single image across your <a href="https://www.wpbeginner.com/start-a-wordpress-blog/" title="How to Start a WordPress Blog – Beginners Guide (UPDATED)">WordPress blog</a> or website. </p>



<p>To add a fade animation to your post thumbnails, simply create a new custom code snippet following the same process described above.</p>



<figure class="wp-block-image size-full"><img width="680" height="311" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-featured-images.png" alt="Adding a fade on mouseover effect to individual images" class="wp-image-171377" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-featured-images.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/fade-featured-images-300x137.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>However, this time add the following code to the editor: </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: css; title: ; notranslate">
img.wp-post-image:hover{
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
-webkit-transition: all 2s ease;
-moz-transition: all 2s ease;
-ms-transition: all 2s ease;
-o-transition: all 2s ease;
transition: all 2s ease;
}
</pre></div>


<p>After that, scroll to the &#8216;Insertion&#8217; box and select ‘Auto Insert.&#8217; Then, open the ‘Location’ dropdown menu and choose ‘Site Wide Header.’</p>



<figure class="wp-block-image size-full"><img width="680" height="194" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/auto-insert-css-1.png" alt="Adding an animation to images on mouseover" class="wp-image-171378" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/auto-insert-css-1.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/auto-insert-css-1-300x86.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>After that, you can go ahead and make the code snippet live using the same process described above.</p>



<p>Now, you can hover the mouse over any featured image to see the fade animation in action.</p>



<p>If you want to add even more image mouseover effects, then see our guide on <a href="https://www.wpbeginner.com/wp-tutorials/how-to-add-image-hover-effects-in-wordpress/" title="How to Add Image Hover Effects in WordPress (Step by Step)">how to add image hover effects in WordPress</a>.</p>



<h4>Bonus: Animate Any Image, Text, Button, and More </h4>



<p>Fade effects are a fun way to make images more interesting, but there are lots more ways to use animations in WordPress. For example, you might use <a href="https://www.wpbeginner.com/wp-tutorials/how-to-create-flipbox-overlays-and-hovers-in-wordpress/" title="How to Create Flipbox Overlays and Hovers in WordPress">flipbox animations</a> to reveal text when a visitor hovers over an image, or use zoom effects so users can explore a picture in more detail.</p>



<p>If you want to try different effects, then <a href="https://www.seedprod.com/"  title="SeedProd - Best Drag &amp; Drop WordPress Website Builder" rel="noopener">SeedProd</a> has over 40 animations that you can add to images, text, buttons, videos, and more. You can even animate entire sections and columns with just a few clicks.</p>



<p>Inside the SeedProd editor, simply click on the content you want to animate, and then select the &#8216;Advanced&#8217; tab in the left-hand menu.</p>



<figure class="wp-block-image size-full"><img width="680" height="346" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/seedprod-advanced-tab.png" alt="Adding fade animations using SeedProd" class="wp-image-171379" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/seedprod-advanced-tab.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/seedprod-advanced-tab-300x153.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>You can then go ahead and click to expand the &#8216;Animation Effects&#8217; section.</p>



<p>After that, simply choose an animation from the &#8216;Entrance Animation&#8217; dropdown, including a wide range of different fade effects.</p>



<figure class="wp-block-image size-full"><img width="680" height="348" src="https://www.wpbeginner.com/wp-content/uploads/2014/02/entrance-animation-seedprod.png" alt="Adding animations to WordPress using SeedProd" class="wp-image-171380" srcset="https://www.wpbeginner.com/wp-content/uploads/2014/02/entrance-animation-seedprod.png 680w, https://www.wpbeginner.com/wp-content/uploads/2014/02/entrance-animation-seedprod-300x154.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>For more information, please see our guide on <a href="https://www.wpbeginner.com/wp-tutorials/how-to-create-a-landing-page-with-wordpress/" title="How to Create a Landing Page With WordPress">how to create a landing page with WordPress</a>.</p>



<p>We hope this article helped you learn how to fade images on mouseover in WordPress. You may also want to see our guide on <a href="https://www.wpbeginner.com/showcase/best-web-design-software-compared/" title="How to Choose the Best Web Design Software (Compared)">how to choose the best web design software</a>, and our expert picks of the <a href="https://www.wpbeginner.com/best-wordpress-popup-plugin/" title="Best WordPress Popup Plugins (Performance Compared)">best WordPress popup plugins. </a></p>



<p>If you liked this article, then please subscribe to our <a href="https://youtube.com/wpbeginner?sub_confirmation=1"  rel="noreferrer noopener nofollow" title="Subscribe to WPBeginner YouTube Channel">YouTube Channel</a> for WordPress video tutorials. You can also find us on <a href="https://twitter.com/wpbeginner"  rel="noreferrer noopener nofollow" title="Follow WPBeginner on Twitter">Twitter</a> and <a href="https://facebook.com/wpbeginner"  rel="noreferrer noopener nofollow" title="Join WPBeginner Community on Facebook">Facebook</a>.</p><p>The post <a href="https://www.wpbeginner.com/wp-themes/fade-images-mouseover-wordpress/">How to Fade Images on Mouseover in WordPress (Simple & Easy)</a> first appeared on <a href="https://www.wpbeginner.com/">WPBeginner</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.wpwife.com/themes/how-to-fade-images-on-mouseover-in-wordpress-simple-easy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="0" type="" />
		</item>
	</channel>
</rss>
