The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Image not displaying through custom field in wordpress

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #40229


    I was trying to customize my theme and got the following problem..
    The image was not displaying on the homepage in img tag even after getting the correct and full path of the image. But then I tried using bloginfo(‘template_directory’) then my image was displayed. The code I used was /product-images/prod-sprunkler.png” /> where product-images is the folder which contain the image named prod-sprunkler.png.

    Now I was trying to get the image through custom field that is I have stored “/product-images/prod-sprunkler.png” in the custom field known as product_image.
    So when I am concatenating these two functions to get the full path I am not getting the desired output and the image is also not displayed.
    Is this concatenation problem or what? And is there any other solution to display images rather then bloginfo()??

    The site url is

    The output is I am not getting any image even after trying all possible combinations…

    I want to retrieve the field like I have done for price, dimensions and product-code..(all 3 are custom fields).

    I have used get_post_meta() for retreiveing the fields..

    please help..

    Chris Coyier

    In the course, I put the images at the ROOT of the websites in /product-images/. That is because on a site like this, the images are part of the content of the site, not the theme. If you’re linking to them with bloginfo(‘template_directory’) that means your linking to them from within the theme folder, which is incorrect. Move the /product-images/ out to the root of the website (e.g. the same level you’ll find your wp-config.php file)


    Sir, I tried as what you said earlier and now as well.. But still not able to get the images in place. Please have a look at the site url . Now I have removed that bloginfo(‘template_directory’) and have used get_post_meta() method to get the required custom field. If you have time I can give you my ftp and wp-admin account so that you can check this matter better.

    Thank You

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.