Home › Forums › General Issues › User info by page name › Reply To: User info by page name
Hi @sc-leslie
You should be able to get the image by using this code:
<?php $background = get_field('background_image_field_name', 'user_'.$user_info->ID); ?>
<img src="<?php echo $background['url']; ?>" alt="<?php echo $background['alt']; ?>" />
Please change the “background_image_field_name” with the name of your custom field.
You can check the $background value by using this code:
echo '<pre>';
var_dump($background);
echo '</pre>';
If it doesn’t work, could you please share the JSON export of your field group and the PHP file of the template?
Thanks!
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.