Home › Forums › General Issues › get_sub_field returning wrong field on ACF Pro 5.7.11 › Reply To: get_sub_field returning wrong field on ACF Pro 5.7.11
I’m still experiencing an issue with missing images similar to Canton.
Given this code, which should pull image headings and then images:
<?php if (get_field('image_heading')) {
echo '<div class="img-heading"><h4>'.get_field('image_heading').'</h4></div>';
}?>
<img src="<?php $image = get_sub_field('image'); echo $image['sizes']['row-shot-big']; ?>" class="img-responsive aligncenter">
The output shows as:
<div class="img-heading"><h4>Programs in Spiritual Psychology</h4></div> <img src="" class="img-responsive aligncenter">
The images don’t show up. This is for the non-pro version, I think. But the issue seemed similar enough to follow up here.
Plugin Name: Advanced Custom Fields
Plugin URI: https://www.advancedcustomfields.com/
Description: Customize WordPress with powerful, professional and intuitive fields.
Version: 5.7.12
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.