• MeltingDog

    (@meltingdog)


    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter MeltingDog

    (@meltingdog)

    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…

    Thread Starter MeltingDog

    (@meltingdog)

    Anyone?

    Thread Starter MeltingDog

    (@meltingdog)

    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.

    Thread Starter MeltingDog

    (@meltingdog)

    PS: the bloginfo(“template_directory”) in the image path was unnecessary as well

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP echo images in post’ is closed to new replies.