WEB trying to make a wordpress theme

Discussion in 'OT Technology' started by BoostedBoogie, Oct 17, 2008.

  1. i'll have various divs in there all with individual <img src> tags, but they don't work for some reason. but if i make the div background image the same source through the css, it works. i have no idea why this is going on, any help?
     
  2. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
  3. pkr

    pkr Guest

    check your referring image location

    make sure if it's in the css stylesheet you call it with a "/" so /images/blah.gif

    if it's inline on the html it should just be "images/blah.gif"
     
  4. RG

    RG New Member

    Joined:
    May 4, 2003
    Messages:
    28,233
    Likes Received:
    0
    Location:
    Connecticut
    provided the images folder is in the same location as the html file
     
  5. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    The problem is that you are not specifying the correct path to your images folder. It works with CSS because the CSS file is in your theme folder. Keep in mind that your WordPress theme is not in the root directory of your server. You need to specify your template path then call the image accordingly.

    Code:
    <img src="<?php bloginfo('template_directory'); ?>/images/image.jpg" alt="image" />
    
     
  6. i'll give that a try guys, thanks. had a feeling it had something to do with the paths.
     
  7. works perfectly, thanks guys! guess i should've read more documentation on wordpress' custom functions -__-
     

Share This Page