WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created an Image Upload field for a User Photo in the User Profile section in the wp-admin using Advanced Custom Fields. I realized ACF could do this per this post: Photo gallery on profile page?

How would I go about capturing the contents of the image src field in ACF? The following does not work:

<?php $publisher_photo = get_field('user_photo'); ?>

<?php echo "<img class='publisher-picture' src='$publisher_photo' />"; ?>

I even tried this, but it does not work either:

<?php $publisher_photo = get_the_author_meta('user_photo'); ?>
<?php echo "<img class='publisher-picture' src='$publisher_photo' />"; ?>

When I try to debug and echo the contents of the $publisher_photo variable, it comes back blank leading me to believe I'm not picking up this field from the User Profile in the correct way.

share|improve this question
In addition, when I do some debugging, such as: <? php echo $publisher_photo; ?> This is not returning anything. The variable appears to be blank. – Matt Jan 1 '13 at 2:32
Thanks for this bit of code. Has worked perfectly... However do you know why it is cropping the image to 150px x 150px? Is it possible to display the original size? Thanks – user47333 Feb 8 '14 at 17:03

Got it working! Here's what solved my problem:

$publisher_photo = get_the_author_meta('user_photo');
$image_src = wp_get_attachment_image_src($publisher_photo);
echo '<img class="publisher-picture" src="'. $image_src[0] .'" />';
share|improve this answer

Because it's not reading your variable $publisher_photo. Try <?php echo '<img class="publisher-picture" src="'. $publisher_photo .'" />'; ?>

share|improve this answer
That didn't work for me..Still shows up blank in the view. – Matt Jan 1 '13 at 2:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.