WordPress Directory Woes

Discussion in 'Web Design and Development' started by harveypooka, Aug 6, 2007.

  1. harveypooka macrumors 65816

    Feb 24, 2004
    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">

    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!
  2. afornander macrumors 6502

    Apr 5, 2006
    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
  3. harveypooka thread starter macrumors 65816

    Feb 24, 2004
    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!;)

Share This Page