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?

  • 1
    "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
  • 1
    I am not following what you mean by "background layout" term. – Rarst Jun 8 '13 at 20:29

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.


You can simply use body_class().

<body <?php body_class( is_page( 'about' ) ? 'special-class' : '' ); ?>>
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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