Site Meter Blogging Pointers » Blog Archive » Adding a background image to your WordPress posts

Adding a background image to your WordPress posts

by

I have been asked several times how to add a background image to your WordPress post. Well it is actually not very difficult and if used correctly it can add a great deal of style to your blog.1) We are going to start by opening up your WordPress admin. panel and going to Presentation - Theme editor - Single Post, you should now be looking at the single.php file. Scroll down on this page until you find:

<?php the_content; ?>

Wrap this in a div tag like this:

<div id=?post_bg?><?php the_content; ?></div>

2) Now lets go to Presentation - Theme editor - Stylesheet and add:

#post_bg {
background: url(’images/post_bg.gif’) no-repeat;
}

Make sure that the background url is pointing to the destination of your background image. If you have a small image and would like to display it lets say on the right side of the post, you can use:

#post_bg {
background: url(’images/post_bg.gif’) no-repeat;

align: right;
}

Instead of post_bg you can name this anything you like as long as it remains the same across all pages.

3) Alternatively, if you would also like to display this background on the posts shown on your blogs homepage, you can open Presentation - Theme editor - Main Index Template. Now scroll down and find:

<?php the_content; ?> 

and wrap it the same as we did before, like this:

<div id=?post_bg?><?php the_content; ?></div>

With these few simple changes we have now added a stylish background image to all posts throughout your blog. I would also like to note that some themes already have a style set for the blog posts, in which case you would simply just add the background url to the existing css.

, , ,


6 Responses to “Adding a background image to your WordPress posts”

  1. gearfbeed Says:

    Подскажите шооблончег под Wordpress 2.6.2, чтобы был похож на ваш http://www.bloggingpointers.com.

    Заранее благодарю)

  2. Ovarcediacar Says:

    Да уж. В этом блоге хоть комментаторы нормальные.. А то пишут обычно в комментарии ерунду всякую.

  3. borya874 Says:

    Отлично написано. Позитива конечно не хватает, но читал на одном дыхании

  4. Gemseisbum Says:

    Очень понравилось, даже не ожидала.

  5. borya874 Says:

    Очень познавательно. Спасибо.


About Blogging Pointers

From the step by step detailed tutorials to assist in the set up of your blog, to the most current news on the blogging front, we've got you covered. You will find powerful articles on supercharging your blog to make it profitable, on kick starting your advertising and maybe even one or two that will make you rethink your positions, or refine your writing techniques. This site is a tool for you to use as you need it, a gift from one blogger to another. We welcome your feedback and comments. Get out there and keep blogging.

Blogging Pointers Author(s)

New Media, Web 2.0 Channel Posts

  • 10 Ways to Make Sure Your SEO Goes Out of Its Way for You
    If they want to have success, companies should do everything they can to ensure that their SEO firm doesn't provide lousy service. Here are 10 tips to keep in mind: 1. Be realistic. Don't waste your [...]
  • Podcasting Transcription
    A Guest Post from Tishia Lee of Tishia Saves Time: When I first started offering transcription services as part of my Virtual Assistant business, transcribing podcasts was not something I [...]
  • Don't Dabble - Make A Commitment
    If you want to get the best bang for your buck, plan on podcasting for the long haul. Podcasters who “test” things out with one or two podcasts and then give up may think that they've given [...]
  • A Question of Podcasting Frequency
    This follows up on yesterday's post about not dabbling in podcasting but rather to make a commitment. Podcasting on a schedule is important when building a community and an audience. Don’t have [...]
  • Do You Twitter About Your Podcast?
    Whenever I release a new episode of Work at Home Moms Talk Radio is pop the link up on my Twitter and invite my followers to come check it out. This has brought me several first time listeners which [...]
  • Looking for Podcast Outsourcing?
    I mentioned having my podcast audio's transcribed in my last post. In case you wonder - no, I do not transcribe them myself. (Shudder the thought - I did enough transcription to last a lifetime in [...]
  • Business Podcasting Benefit: Be An Industry Thought Leader
    I often ask people 'Why haven't you started your podcast yet?' and a common reply is 'I don't feel like I'm enough of an expert to cover the topic I'm interested in.' Enough of an expert? [...]
  • Business Podcasting Benefit: More Content
    Building a business on the web requires that you generate a lot of content. Content on your website draws traffic both through search engines (people searching for your content) and through links [...]
  • Business Podcasting Benefit: Deeper Relationships
    A website visitor is just a website visitor. You can't really say that you have a relationship with someone who has only visited your website can you? But when the web visitor subscribes to [...]
  • Business Podcasting Benefit: Increased Market Exposure
    When you consider how many millions of people are walking around with iPods and other Mp3 players you have to wonder, wouldn't it be awesome if they came looking for you? Well they do. Ipod [...]

Hot Off The Press