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'm using advanced custom fields and have setup an image field for my users to add an image in their profile. I'd need to display this image on post pages, so i've tried the following...

$attachment_id = the_author_meta('author_logo');
<?php echo the_author_meta('author_logo'); ?>
<?php wp_get_attachment_image_src( $attachment_id )?> 
<?php wp_get_attachment_url( $attachment_id ); ?>

The output is always the image attachment ID never the URL. What can I change to output the image path URL?


share|improve this question
up vote 1 down vote accepted

From codex:

The the_author_meta Template Tag displays the desired meta data for a user. If this tag is used within The Loop, the user ID value need not be specified, and the displayed data is that of the current post author. A user ID can be specified if this tag is used outside The Loop.

If the meta field does not exist, nothing is printed.

NOTE: Use get_the_author_meta() if you need to return (not display) the information.

So, replace the_author_meta() with get_the_author_meta(). You can then use wp_get_attachment_image() to get an image element ready for outputting to the page.

$id = get_the_author_meta('author_logo');
if ($id) {
    echo wp_get_attachment_image($id);
share|improve this answer

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.