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 < ?php bloginfo('template_directory');?>/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()??
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 http://acheiver.netne.net/here/ . 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.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".