• Hi,
    I just tried to create my first own WP theme. Programmed the design in HTML and now I wanted to import it into an existing theme so I don’t need to write a new one.

    But whenever I try to include a picture, WP just ignores it. No matter if it is a CSS bg image or an img tag, nothing works, it’s just not there. There isn’t even this little image that says there should be a picture but it can’t be displayed, there is just nothing, like it wasn’t in the code. But it is, not only in my source but also after it came from the server.

    The pictures from the theme get displayed perfectly well, only mine don’t…

    It can’t be because of the theme either, I tried 3 completely different themes including the original one.

    What is wrong here?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter hoktar

    (@hoktar)

    Oh and I tried to put the images in the header, index and footer.php, nothing works.

    likely, the file paths to the images are wrong …
    or the images are not uploaded to the right location.

    just a guess, without a link to the site.

    btw: firefox for instance does not show little squares with red crosses for missing images.

    Thread Starter hoktar

    (@hoktar)

    “firefox for instance does not show little squares with red crosses for missing images. ”

    Damn, I thought so to, I haven’t seen those little bastards for a while now 😀

    But still, the path is correct, the images are in the standard “image” folder any theme usually has which is at the same level as the header.php. Therefore the path is “images/myimage.jpg” when I put it in header.php. But it doesn’t work.

    the standard “image” folder any theme usually has which is at the same level as the header.php

    wrong – the images folder is off the style.css level; relative file paths work only for the background images referenced in style.css.

    if you use images, including for css, in header.php or any other template files, you need to use absolute file paths, which is made easier by using bloginfo('template_url'):
    http://codex.wordpress.org/Function_Reference/bloginfo

    for instance in embedded styles in header.php:

    <style type="text/css" media="screen">
    #page { background: url(<?php bloginfo('template_url'); ?>/images/page_bg.jpg; }
    </style>
    Thread Starter hoktar

    (@hoktar)

    EDIT

    Thread Starter hoktar

    (@hoktar)

    Hail alchymyth for he is God.

    Thanks a lot dude, you saved my day!

    Hey, I’m having some of the same problems experienced. I’ve tried the tips above but I’m still having no luck.

    This is what I want the theme to look like; but this is what I get.

    Any help would be appreciated, is there something wrong with my CSS coding?
    body { background: url(<?php bloginfo('template_url'); ?>/images/bg2.png); repeat-x #FFFFFF; font-size:12px; font-family:'Lucida Grande', 'Lucida Sans Unicode', Tahoma, Arial, san-serif; color:#000000;}

    Thread Starter hoktar

    (@hoktar)

    Is this code from your .css style sheet?
    Because then the paths need to be relative!

    So this should do it:

    body { background: url(images/bg2.png); repeat-x #FFFFFF; font-size:12px; font-family:'Lucida Grande', 'Lucida Sans Unicode', Tahoma, Arial, san-serif; color:#000000;}

    Awesome thank you! That did the trick.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘no images in theme’ is closed to new replies.