WordPress.org

Support

Support » Themes and Templates » Images in main post page

Images in main post page

  • 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi
    Forum Moderator

    @esmi

    Always use absolute image urls – not relative ones.

    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.

    esmi
    Forum Moderator

    @esmi

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

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

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Images in main post page’ is closed to new replies.