<?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; background color</title>
	<atom:link href="http://www.wpwife.com/category/background-color/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 Add Smooth Background Color Change Effect in WordPress</title>
		<link>http://www.wpwife.com/themes/how-to-add-smooth-background-color-change-effect-in-wordpress</link>
		<comments>http://www.wpwife.com/themes/how-to-add-smooth-background-color-change-effect-in-wordpress#comments</comments>
		<pubDate>Tue, 20 Mar 2018 13:24:13 +0000</pubDate>
		<dc:creator><![CDATA[Editorial Staff]]></dc:creator>
				<category><![CDATA[background color]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Themes]]></category>

		<guid isPermaLink="false">http://www.wpbeginner.com/?p=50805</guid>
		<description><![CDATA[
<p>Do you want to add a smooth background color change effect on your WordPress site? You may have seen on some popular websites where the background color of a specific area or the whole web page automatically transitions from one color to another. This beautiful&#8230;&#160;<strong><a href="http://www.wpbeginner.com/wp-themes/how-to-add-smooth-background-color-change-effect-in-wordpress/">Read More &#187;</a></strong></p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/wp-themes/how-to-add-smooth-background-color-change-effect-in-wordpress/">How to Add Smooth Background Color Change Effect in WordPress</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Do you want to add a smooth background color change effect on your WordPress site? You may have seen on some popular websites where the background color of a specific area or the whole web page automatically transitions from one color to another. This beautiful effect can help you get users attention and improve engagement on your website. In this article, we will show you how to easily add a smooth background color change effect in WordPress. </p>
<p><img title="Adding smooth background color change effect in WordPress" src="http://cdn.wpbeginner.com/wp-content/uploads/2018/02/bgcolorchangewp.png" alt="Adding smooth background color change effect in WordPress" width="550" height="340" class="alignnone size-full wp-image-50813" /></p>
<h4>What is Smooth Background Color Change Effect?</h4>
<p>Smooth background color change effect allows you to automatically transition between different background colors. The change happens slowly going through different colors until it reaches the final color. It looks like this:</p>
<p><img title="Color change effect animation" src="http://cdn4.wpbeginner.com/wp-content/uploads/2018/02/bganimate.gif" alt="Color change effect animation" width="550" height="231" class="alignnone size-full wp-image-50814" /></p>
<p>This technique is used to capture user attention with gentle effects that are pleasing to the eye. </p>
<p>That being said, let&#8217;s take a look at how to add this smooth background color change effect in any WordPress theme. </p>
<h4>Adding Smooth Background Color Change Effect in WordPress</h4>
<p>This tutorial requires you to add code in your WordPress files. If you haven&#8217;t done this before, then please take a look at our guide on <a href="http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/" title="Beginner’s Guide to Pasting Snippets from the Web into WordPress">how to copy and paste code in WordPress</a>. </p>
<p>First, you need to find out the CSS class of the area that you want to change. You can do this by <a href="http://www.wpbeginner.com/wp-tutorials/basics-of-inspect-element-with-your-wordpress-site/" title="Basics of Inspect Element: Customizing WordPress for DIY Users">using the Inspect tool</a> in your browser. Simply take your mouse to the area you want to change and right click to select the Inspect tool. </p>
<p><img title="Find CSS class" src="http://cdn3.wpbeginner.com/wp-content/uploads/2018/02/findcssclass.png" alt="Find CSS class" width="550" height="303" class="alignnone size-full wp-image-50810" /></p>
<p>Next, you need to write down the CSS class you want to target. For example, in the screenshot above we want to target the widget area in the bottom which has the CSS class &#8216;page-header&#8217;. </p>
<p>In the next step, you need to open a plain text editor on your computer and create a new file. You need to save this file as wpb-background-tutorial.js on your desktop. </p>
<p>Next, you need to add the following code inside your JS file: </p>
<pre class="brush: php; title: ; notranslate">
jQuery(function($){
        $('.page-header').each(function(){
            var $this = $(this),
			colors = ['#ec008c', '#00bcc3', '#5fb26a', '#fc7331'];

            setInterval(function(){
                var color = colors.shift();
                colors.push(color);
                $this.animate({backgroundColor: color}, 2000);
            },4000);
        });
        }); 
</pre>
<p>If you study this code, then you will notice that we have used the CSS class we want to target in the code. We have also added four colors. Our smooth background effect will start from the first color, then transition to the next color, and keep cycling through these colors. </p>
<p>Don&#8217;t forget to save your changes to the file. </p>
<p>Next, you need to upload wpb-bg-tutorial.js file to your WordPress theme&#8217;s /js/ folder <a href="http://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/" title="How to use FTP to upload files to WordPress for Beginners">using FTP</a>. If your theme doesn&#8217;t have a js folder inside it, then you need to create one. </p>
<p><img title="uploadjs" src="http://cdn3.wpbeginner.com/wp-content/uploads/2018/02/uploadjs.png" alt="Upload your javascript file" width="550" height="278" class="alignnone size-full wp-image-50811" /></p>
<p>After uploading your JavaScript file, it is time to load it in WordPress. </p>
<p>You need to add the following code to your theme&#8217;s <a href="http://www.wpbeginner.com/glossary/functions-php/" title="What is functions.php file in WordPress?">functions.php</a> file. </p>
<pre class="brush: php; title: ; notranslate">
function wpb_bg_color_scripts() {    
wp_enqueue_script( 'wpb-background-tutorial',  get_stylesheet_directory_uri() . '/js/wpb-background-tutorial.js', array( 'jquery-color' ), '1.0.0', true ); 
 } 
add_action( 'wp_enqueue_scripts', 'wpb_bg_color_scripts' ); 
</pre>
<p>This code <a href="http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/" title="How to Properly Add JavaScripts and Styles in WordPress">properly loads the JavaScript</a> file and the dependent jQuery script that you need for this code to work. </p>
<p>That&#8217;s all, you can now visit your website to see it in action. You will notice the smooth background color change effect in the area that you targeted. </p>
<p>There are many other ways to use background colors in WordPress to capture user attention or make your content pop-out. For example, you can try: </p>
<ul>
<li><a href="http://www.wpbeginner.com/plugins/how-to-add-a-full-screen-background-image-in-wordpress/" title="How to Add a Full Screen Background Image in WordPress">Add fullscreen background images</a></li>
<li><a href="http://www.wpbeginner.com/plugins/how-to-add-youtube-video-as-fullscreen-background-in-wordpress/" title="How to Add YouTube Video as Fullscreen Background in WordPress">Add fullscreen video backgrounds</a></li>
<li><a href="http://www.wpbeginner.com/wp-themes/how-to-randomly-change-background-color-in-wordpress/" title="How to Randomly Change Background Color in WordPress">Random background colors on each page load</a></li>
<li><a href="http://www.wpbeginner.com/wp-themes/how-to-add-a-parallax-effect-to-any-wordpress-theme/" title="How to Add a Parallax Effect to Any WordPress Theme">Add parallax effects to any WordPress theme</a></li>
<li><a href="http://www.wpbeginner.com/wp-themes/how-to-style-each-wordpress-post-differently/" title="How to Style Each WordPress Post Differently">Style individual posts with different backgrounds</a></li>
</ul>
<p>We hope this article helped you learn how to easily add smooth background color change effect in WordPress. You may also want to see our list of the <a href="http://www.wpbeginner.com/beginners-guide/best-drag-and-drop-page-builders-for-wordpress/" title="5 Best Drag and Drop WordPress Page Builders Compared (2018)">best WordPress page builder plugins</a> that you can try. </p>
<p>If you liked this article, then please subscribe to our <a href="http://youtube.com/wpbeginner?sub_confirmation=1" title="WPBeginner on YouTube"  rel="nofollow">YouTube Channel</a> for WordPress video tutorials. You can also find us on <a href="http://twitter.com/wpbeginner" title="WPBeginner on Twitter"  rel="nofollow">Twitter</a> and <a href="https://www.facebook.com/wpbeginner" title="WPBeginner on Facebook"  rel="nofollow">Facebook</a>.</p>
<p>The post <a rel="nofollow" href="http://www.wpbeginner.com/wp-themes/how-to-add-smooth-background-color-change-effect-in-wordpress/">How to Add Smooth Background Color Change Effect in WordPress</a> appeared first on <a rel="nofollow" href="http://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wpwife.com/themes/how-to-add-smooth-background-color-change-effect-in-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="0" type="" />
		</item>
	</channel>
</rss>
