Creating a custom background

The Twenty Ten WordPress theme is packaged with an option that allows you to change the background to a different color or use an image for your background. To use the nifty, built-in custom background feature to change the Twenty Ten background for your blog, follow these steps:

1. Click the Background link under the Appearances menu.

The Custom Background page loads in the Dashboard.

2. To change the background color, type the hexadecimal color code in the Color text box.

If you don't know what hex code you want to use, click the Select a Color link and click on a color within the provided color wheel (see Figure 13-2).

A hexadecimal (or hex) code represents a certain color. Hex codes always start with a hash symbol (#) and have six letters and/or numbers to represent a particular color; in this case, #d5d6d7. I talk more about hexadecimal values in the section "Changing the background using CSS," later in this chapter.

3. To use an image file for the background, upload an image from your computer.

Click the Browse button under the Upload New Background Image and select a file from your computer. Then click the Upload button.

4. Change the display options for your new background image.

• Position: Select Left, Center, or Right to set the screen position of the background image on your Web site.

• Repeat: Select No Repeat, Tile, Tile Horizontally, or Tile Vertically in the drop-down menu to set the image repeat behavior of the background image on your Web site.

• Attachment: Select Scroll to set the background image to scroll down the page or select Fixed to set the background image in a static position (so it doesn't scroll down the page).

Figure 13-2:

The color wheel selector on the Custom Background page.

Figure 13-2:

The color wheel selector on the Custom Background page.

5. Save your changes.

Be sure to click the Save Changes button before navigating away from the Custom Background page. Otherwise, your new settings won't be saved.

You can add the Custom Background option to any theme with just a few lines of code. Just follow these steps:

1. Browse to the Edit Themes page and click the Theme Functions (functions.php) template.

The Theme Functions template opens in the text editor on the left side of the page.

2. Add the following line of code to the Theme Functions template:


This line of code tells WordPress that your theme has added the Custom Background feature.

3. Click the Save File button.

The Theme Functions template is saved, along with your changes. The Background link now displays below the Appearances menu.

4. View your Web site page to see your changes.

Was this article helpful?

0 0
Blogging From The Beginning

Blogging From The Beginning

The Blogging From The Beginning course was specifically designed with these people in mind. It starts at the very beginning, by helping them choose the right platform and takes them all the way though creating content, getting traffic and making money from their blog. It is simple, straight forward information that will help them even if they've never heard of blogging before. It will teach them how to get started and quickly harness the power of blogging for themselves.

Get My Free Ebook

Post a comment