Support

Account

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">&nbsp;';
    	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"