The MU forums have moved to

Using custom fields in the template (2 posts)

  1. DannyM
    Posted 14 years ago #

    I'm attempting to use the get_post_custom_values() function to retrieve a custom field for a post titled "news-image".

    I want to use this variable as the src attribute for an <img />

    Here is my code:

       $imgSrc = get_post_custom_values('news-image');
    <img src="<?php echo $imgSrc[0]?>" />

    In the HTML the src continues to be null. You can view my page at

    What am I doing wrong?

  2. parkstreet
    Posted 14 years ago #

    Scroll to the bottom of this post. It may give you some idea on how to change your above syntax so that it works.

About this Topic

  • Started 14 years ago by DannyM
  • Latest reply from parkstreet