Treehouse: Grow your CSS skills. Land your dream job.

[Solved] WordPress images not showing

  • # January 8, 2010 at 7:43 pm

    Hey guys,

    I’m using wordpress as a backend, and I’m having some issues with images.

    In my theme folder, I have an images folder for my photos.

    What works:
    If I create a div an assign it a background-image via css, it works.

    css for a div
    background-image: url(images/picture.jpg);

    What doesnt’ work:
    just a plain img tag placed on a page.

    this doesn’t work, only alt text shows

    Is there something that is a part of wordpress stopping this?

    # January 8, 2010 at 10:25 pm

    To a WP installation, that path is null. You need to point it to the theme folder…easiest way to do this is use the PHP function that will always cause WP to start at the root of your template directory:

    < ?php bloginfo('template_directory'); ?>

    In your case:

    # January 9, 2010 at 1:06 pm

    Thank you very much Luminated

    That worked like a charm

    Viewing 3 posts - 1 through 3 (of 3 total)

    You must be logged in to reply to this topic.


    CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by Media Temple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.

    *May or may not contain any actual "CSS" or "Tricks".