Using Header and Background Images

If your theme supports custom header and background images, you'll see two additional menu items under Appearance. Let's start with backgrounds. Go to Appearance Background to get started. Figures 6-7 and 6-8 show the process of uploading a background image and setting the display options.

Figure 6-7. Uploading a background image

Remove Background Image

Tttis will resnove tuckgrounO -mag*. You mil rwi h awe to retrieve any cimamlxwani. RwnOv* «iikflround

Figure 6-8. Setting the background image display options

The background will be added to your theme using the wp_head() hook. You can specify a background image in your stylesheet, and you'll still be able to replace it using the custom background options. The CSS cascade dictates that styles added directly to a document override those specified in a linked (or imported) stylesheet.

Listing 6-1 shows resulting style block. In this example, you're uploading a file called bgsquare.jpg. This file will be added to the media library, although it is not attached to any particular post.

Listing6-1. Custom background styles inserted into the theme <head>

<meta name="generator" content="WordPress 3.0" /> <style type="text/css"> body {

background-image:url('http://wordpress/wp-content/uploads/2010/04/bgsquare.j pg'); background-repeat: repeat; background-position: top left; background-attachment:

fixed;}

0 0

Post a comment