Quick easy one, its stumped me!

Hi All this is probably a real easy one that has me stumped, I’m using a plugin called magic fields on wordpress and am trying to output the URL for an image, it prints fine on the page but the quotes won’t come out correctly they show as little squares, I’m using PHP and mySql, can anyone help my quotes magically appear please! :wink:

my code is:

<img src=”$my_image_url = get(‘my_image’);” />

Doesn’t look like you’re using any PHP. You need to wrap your function call


<img src="<?php get('my_image'); ?>" />

That assumes that get() echos directly (as WP seems to love doing). If not you’ll need to echo.

What is the value of the get() call?

cool thanks, of course it was’nt wrapped, doh!, sorry posted the wrong bit of code, managed to get it working, though with

<img src=“<?php echo $my_image_url = get(“my_images”); ?>” />

The echo did help, cheers! :wink: Have a great day :cool:

Do you use $my_img_url later in the script? If not, this will do:


<img src="<?php echo get('my_images'); ?>" />

nice one, cheers mate