Forums

[resolved] 'template_url' not working (3 posts)

  1. ksporman
    Member
    Posted 1 year ago #

    i am currently building a website for a local "visit the city".

    when i try and use the code <?php bloginfo('template_url'); ?> in my css, i cannot see the images. but if i hardcode the full domain in, it works.

    the tag works fine on other pages, just not my stylesheet?

    http://www.visitdunkirk.com/new/visitdunkirk/

    Thnks

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    the tag works fine on other pages, just not my stylesheet?

    that is right, if you use styles within the template files, then the tag should be used and works ok;
    however, you can't (and you don't need to) use php code in style.css;

    if the background images are in the /images folder of your theme, this should work in style.css:

    background-image:url(images/headerbg.png);

    there should be no need to use the full path, such as here:
    background-image:url(http://www.visitdunkirk.com/new/visitdunkirk/wp-content/themes/visitdunkirk/images/headerbg.png);

  3. ksporman
    Member
    Posted 1 year ago #

    i feel like an idiot, sometimes i worry myself. thank you very much!

Topic Closed

This topic has been closed to new replies.

About this Topic