WordPress.org

Ready to get started?Download WordPress

Forums

Stuck trying to insert an image into a custom homepage template (5 posts)

  1. rereradu
    Member
    Posted 4 years ago #

    I just cannot figure out what is wrong with this... I am trying to insert an image into the homepage template that I created, but it just doesn't show up. I am running WP on localhost and I have placed the picture in the theme's image folder (atahualpa). Any idea? Thx.

  2. rereradu
    Member
    Posted 4 years ago #

    so when I am trying this " <img src="./images/picture.png" width="40" height="65" alt=""> " it doesn't show anything. If anyone has at least one suggestion I could follow...

  3. Scoe
    Member
    Posted 4 years ago #

    I have the same problem.

    The reason for this is because the link ./images/picture.png doesnt actually exist (e.g. http://www.domain.com/images/picture.png will not find anything.), this is because the theme folders are all created through functions in the main wordpress code.

    my attempt (which did not work) was to include the uri into the source of the file with php, It ended up having lots of unknown symbols :S

    If anyone else has an idea on how to solve this, please let us know :)

    Thanks

  4. Scoe
    Member
    Posted 4 years ago #

    found a sollution:

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

    that one was bugging me :)

  5. mirroreflex
    Member
    Posted 4 years ago #

    try using this html tag for picture:
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/yourimage.gif" width="xxx" height="xxx" title="title for picture" alt="alt for picture" />

Topic Closed

This topic has been closed to new replies.

About this Topic