Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

harveypooka

macrumors 65816
Original poster
Feb 24, 2004
1,291
0
I'm designing a theme for WordPress and for some reason cannot get my stylesheet to display a background for a div.

I think I'm missing something simple here, so I need someone to point it out for me.

My XHTML is:

<div id="header">
</div>


My CSS is:

#header {
background-image: url("<?php bloginfo('template_directory'); ?>/images/hp2.gif");
}


I'm using the template_directory tag which is:

"The code <?php bloginfo('template_directory'); ?> inserts the URL of the template directory into the template output. You can append any additional URI information to this output to reference files in your Theme."

The URL to the background image is correct: http://www.myserver.com/public_html/wp-content/themes/green/images/hp2.gif

What gives? If I can't solve this or get an answer I'm going to throw my iMac out the window!
 
the style.css should be in the same directory as the images folder. so it should only need to look like this.

#header {
background:url('<?php bloginfo('template_directory'); ?>/images/hp2.gif');
}

the link to the image is also a bad link
 
the style.css should be in the same directory as the images folder. so it should only need to look like this.

#header {
background:url('<?php bloginfo('template_directory'); ?>/images/hp2.gif');
}

the link to the image is also a bad link

style.css is in the directory and the link doesn't work because I substituted my server name for 'myserver'. I was just mentioning the path as it is correct and don't want anyone to see my awful design!;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.