Forums

Images within HTML code of my theme not visible (3 posts)

  1. Ninja Master Jimmy Wong-Fu
    Member
    Posted 1 year ago #

    Hi everyone,

    I have just modified an existing wordpress theme with my own html/css mock site. The problem is this:

    All of my images are in a folder called 'images' within my theme folder.

    I can see all of the graphics defined by the CSS, but NOT the graphics defined within the HTML itself.

    For example: I have an image source in my header for the logo that is coded like this: <img src="images/logo.png" alt="logo" /> = no image displayed(only alt information can be seen)

    But in CSS: background-image:url('images/background.png') = image displays fine.

    Anyideas why this is happening?

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    images in the php/html need to be referenced using absolute file paths:

    <img src="<?php bloginfo('template_url'); ?>/images/logo.png" alt="logo" />

    http://codex.wordpress.org/Function_Reference/bloginfo

  3. Ninja Master Jimmy Wong-Fu
    Member
    Posted 1 year ago #

    Thanks Alchymyth,

    Works a treat - now my website is back on track!

    Case closed

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.