MeltingDog
Member
Posted 6 months ago #
Hi guys,
Bit of a weird one - I have a php loop that spits out an image path from a database. I know I have to use bloginfo("template_directory") to display the image but I'm not sure how to exactly using my echo function. I need to some how combine that template directory php and the $row php...
The code I have is:
echo '<img src="' . bloginfo("template_directory") . $row['itemimage'] . '"/>';
But it of course displays that directory as a string. Any other way I configure it just creates an error.
Can anyone help me out at all? Thanks!
MeltingDog
Member
Posted 6 months ago #
I should mention that I am using a plugin that allows me to include PHP in the my posts/pages. I have tested it and it works fine - just this issue with the images...
MeltingDog
Member
Posted 6 months ago #
MeltingDog
Member
Posted 5 months ago #
Yeah - I figured it out on another forum. It was to do with WP being installed on htdocs/xampp rather than just in the htdocs directory. Also file permissions where blocking Apache.
MeltingDog
Member
Posted 5 months ago #
PS: the bloginfo("template_directory") in the image path was unnecessary as well