Home › Forums › General Issues › Images Not Showing Up on Pages › Reply To: Images Not Showing Up on Pages
Hi Elliott,
I was excited to try the code found on the page you referred to. After trying it out, it still did not work. This is the code I used with my field name substituted in…it’s been inserted under the word “Profile”:
<?php
$author_id = get_the_author_meta( 'ID' );
$author_badge = get_field('donor_image1', 'user_'. $author_id ); // image field, return type = "Image Object"
?>
<img src="<?php echo $author_badge['url']; ?>" alt="<?php echo $author_badge['alt']; ?>" width="200" height="100" />
Keep in mind that this isn’t for an actual post page but is for an author page (author.php). The url is http://choochooclan.com/surrogate/author/egglady/ or http://choochooclan.com/surrogate/?author=11 Given that the author ID is 11, I would think that the code would pull that in dynamically and then look for the appropriate image field which is donor_image1 and then display it accordingly. As you can see this is not happening. Is there something else I need to add to the code?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.