• Hi there. I’ve set WordPress 1.5.2 up on my own server (that is, I installed Apache so I can locally develop it). I’ve duplicated the default theme in the WP-CONTENT/THEMES directory, and renamed it “butterfly.” I’ve created a header image and called it “butterflyheader.jpg”, and placed it in the “butterfly/images” folder.

    The problem is that it won’t show up in my code. I can’t tell if it’s just the fact that I’m new to this, or whether it’s an issue with my server or whatever. I’ve placed this code in my stylesheet file:

    #header {
    background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/butterflyheader.jpg”)
    no-repeat bottom center; }

    #headerimg {
    margin: 7px 9px 0;
    height: 230px;
    width: 742px; }

    In my header.php file, I added:

    <div id=”header”>
    <div id=”headerimg”>

    </div>
    </div>

    …but nothing shows. When I used a background image in my stylesheet, it appeared fine. And when I go to the actual URL of my header image (i.e http://local.jessmina.com/wp-content/themes/butterfly/images/butterflyheader.jpg),
    it appears fine in my browser.

    I’m sure it’s just some simple problem because I’m a beginner, but I hope somebody can advise me on what to do – the tutorial I’m using is great, but unfortunately it doesn’t offer an example of how to create a header containing an actual image. 🙂

    P.S How would I best go about having a background colour for the entire page, and then having a “background image” to contain the rest of the content?

Viewing 1 replies (of 1 total)
  • Thread Starter bumblebee

    (@bumblebee)

    Just as a follow-up, I had a go at putting this code in the header.php file (within the div id=”headerimg” tags):

    <img src=”<?php bloginfo(‘stylesheet_directory’); ?>/images/amelieheader.jpg”>

    …and it showed the image. However, is this “correct” syntax? Is there a better way to do it? Because it seems that the div id tag linking to headerimg is there for a reason.

Viewing 1 replies (of 1 total)

The topic ‘Header image not showing. Coding newbie.’ is closed to new replies.