Quantcast
Channel: WordPress Cheat Sheets » admin
Viewing all articles
Browse latest Browse all 39

WordPress Code to Change Background Image of Your WP Theme

$
0
0

This is a short and sweet step by step tutorial for changing the background of your WordPress theme. Read the WordPress CSS Basics: Changing Body Background Image article for a more detailed tutorial on changing background of your theme.

Step 1: Find and Edit the CSS file

Go to the following area of your WordPress dashboard to edit the CSS file of your WordPress theme:

Appearance > Editor > Stylesheet (style.css)

Step 2: Find the CSS Code of the Body Element

Search for “body” in the style.css file that you are editing. It should look similar to the following screenshot:

Finding the CSS code for the body element

Step 3: Specify the Image URL

Upload the background image file that you want to use to the “images” directory of your theme (if it doesn’t have one then you can create one inside the theme folder).

The following example CSS code shows you how to specify the background image URL for your theme (use the one that works best for you):

Background Image CSS Example 1

body {
background: #FFFFFF url(images/theme-background.jpg) fixed;
}

Background Image CSS Example 2

body {
background: #FFFFFF url(images/theme-background2.jpg) repeat;
}

That should change the background of your site and use the image that you specified as the background. Save the style.css file by hitting the “update” button in the theme editor and view your site to see how it looks.


Viewing all articles
Browse latest Browse all 39

Trending Articles