WordPress.org

Ready to get started?Download WordPress

Forums

Images in main post page (5 posts)

  1. urielk
    Member
    Posted 3 years ago #

    Hi,

    I am attempting to place images in the main post page. My site contains a header, footer, main content, sidebar, and an image are to the right of the sidebar. I am having problems showing my images. The images are in the image folder. The css shows margins, image size etc. I placed the following code in my index.php.

    <div id="imagegallery"><img src="images/imgglry.png" alt="images of Flowers" /></div>
    
           <div id="photo"><img src="images/susan.png" alt="Vendor Photo" /></div>

    The images do not show up. I only see the alternate text. Any suggestions will be appreciated. Thank you.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Always use absolute image urls - not relative ones.

  3. urielk
    Member
    Posted 3 years ago #

    Hi,

    Thanks for the suggestion. My images are located in the image folder of my custom theme I call "Genie". In looking at the info I found it says an absolute link format would be - for my example

    <img src="http://www.example.com/images/picture.png">

    In this case would example.com be the name of my blog or the name of my theme? Thank you kindly for the clarification.

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Try using
    <img src="<?php get_stylesheet_directory_uri();?>/images/picture.png">

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

  5. urielk
    Member
    Posted 3 years ago #

    Sorry. NO CIGAR. Does not work. Only thing that works is using image as background in the style.css but then placement is all messed up. This wordpress thing is turning out to be a damn nuiisance

Topic Closed

This topic has been closed to new replies.

About this Topic