Home › Forums › Add-ons › Repeater Field › get_field occassionally returning string with repeater field › Reply To: get_field occassionally returning string with repeater field
Update II: In response to the issue of my thumbnails not displaying; I have figured this out if anyone else with similar issues stumbles into this…
Basically, for me, I eliminated the then unnecessary pre_get_posts filter and then replaced;
<?php $image = wp_get_attachment_image_src(get_field('event_thumbnail'), 'full'); ?>
<img src="<?php echo get_field('event_thumbnail'); ?>" alt="<?php echo get_the_title(get_field('event_thumbnail')) ?>" />
with:
<?php $image = get_field('event_thumbnail'); ?>
<img src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('event_thumbnail')) ?>" />
For some reason (probably some conflict again), wp_get_attachment_image_src
returns as false. But get_field('event_thumbnail')
returns the image anyway, so all that was needed was to remove this wp_get_attachment_image_src
function!
Hope this helps someone!
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.