Home › Forums › Front-end Issues › Trouble with Image Object vs Image URL › Reply To: Trouble with Image Object vs Image URL
I tried DEBUG and nothing significant came up.
I also tried the
<?php
$image = get_field('image');
echo '<pre>';
var_dump( $image );
echo '</pre>';
?>
But nothing happened there either. Was some text supposed to show on the page? I haven’t used
before. I tried changing it to this:
<?php $Member = get_field('image');
echo '<p class="Test"> ';
var_dump($Member);
echo '</p>';?>
Interesting thing is that I do not see <p class="test"> </p> when I view source. It's like that php isn't happening.
While I have the code asking for only the ['url'], it gives me the entire array. It's very confusing.
I tried rebuilding a fresh page using the template, but the error continues. Not sure why one page it works and the other it doesn't.
BUT I FIXED IT. It makes no sense, but it works. Since I was getting nowhere on the one page I went to the other page and I changed this:
<img src="<?php echo $SingleMember['url']; ?>" alt="<?php echo $SingleMember['alt']; ?>"/>
to this:
<img src="<?php the_field('image'); ?>" alt="<?php echo $SingleMember['alt']; ?>"/>
And now it works on both pages. The setting in ACF is now Return Value: "Image URL"
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.