WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm seeing that a lot of sites (moz.com,hubspot.com) are using a background image as a layout. How do I add a single background image easily onto WordPress? I also want to add the layout here: http://moz.com/blog onto my blog. How do I do this?

share|improve this question
"Backgroound image as layout", ehm what? – Rarst Jun 8 '13 at 20:20
I want to add a background layout image kind of like Moz.com. – afang Jun 8 '13 at 20:28
I am not following what you mean by "background layout" term. – Rarst Jun 8 '13 at 20:29
up vote 0 down vote accepted

This assumes that you want to add a background image for a specific page:

Create your CSS class for the background you want.

body.custombg {background: url("images/background.gif"); }

In the header, you can use something like this to check for a specific page.

<body <?php if(is_page(123)) echo 'class="custombg"' ?>>

See Conditional Tags for more ideas of what you can do.

As for the layout of that site, you should contact them and find out if they are using a publicly available theme or if it is a custom design.

share|improve this answer

You can simply use body_class().

<body <?php body_class( is_page( 'about' ) ? 'special-class' : '' ); ?>>
share|improve this answer
Where do I put this? – afang Jun 12 '13 at 12:45
Ehm... it's a body HTML tag? Search in your template, replace it with the answers code... – kaiser Jun 12 '13 at 13:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.