treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Problem changing my image references for WordPress

  • Hi, another novice question :)

    I've started to change the reference's to images in my web template in order to make it WordPress compatible.

    Here's what I'm doing now

    <?php bloginfo('template_directory') ?>/assets/ *Assets is my image folder which used to be called images

    I have found some with dots before the file. The query I have is what to do with the '...' before the '/' Could somebody show me what they would change the example below to please.

    background:url(../images/button-h.png) left top no-repeat;

    Thanks again
  • <?php bloginfo('template_directory') ?>/images/button-h.png

    That means "Theme Folder > Images Folder > button-h.png". So you would use that if you were working on a template like 'page.php' and you needed to insert an image like this:
    <img alt="" src="<?php bloginfo('template_directory') ?>/images/button-h.png">

    If you want to go from your style.css file, you'll need to do this:
    background:url(images/button-h.png) left top no-repeat;

    It's relative to where your style.css file is, in this case it's in the root of your theme's folder.