Have to say that I agree with Willy. I understand a lot of good work goes into the development of ACF, and I;m sure the intent is good, but I’m finding the recent UI updates quite frustrating. When working with flexible content fields, the sub fields can be quite unresponsive to clicks and ‘janky’, until suddenly the the clicks are registered and the fields open and close quickly to catch up.
@willy-m Did you ever contact the devs?
Please ignore / delete this post, my code was wrong. Mea culpa.
I fixed it. For anyone else struggling, ths worked for me:
<?php if( have_rows('text_area') ) : while ( have_rows('text_area') ) : the_row(); if( get_row_layout() == 'text' ) : if(get_sub_field('columns') == "1") : ?> <div> <?php the_sub_field('first_column_text') ;?> </div> <?php elseif(get_sub_field('columns') == "2") : ?> <div> <?php the_sub_field('first_column_text'); ?> <?php the_sub_field('second_column_text'); ?> </div> <?php endif; endif; //get_row_layout endwhile; //have_rows endif; //have_rows ?>
Thanks to James in support for the fix below:
<?php $image_ids = get_field('gallery', false, false); $shortcode = '[gallery link="file" ids="' . implode(',', $image_ids) . '"]'; echo do_shortcode( $shortcode ); ?>
Now works like a charm 🙂
Hmm, I’m not sure that helps me. I tried swapping out $image_ids for $images etc but got the same results. I shouldn’t need to alter any HTML. I’ve integrated fancybox into the WP Gallery via my functions.php file, so on normal pages the WP Gallery acts like fancybox right out of the box.
It’s only when WP Gallery is called using this add-on that clicking a thumbnail opens the attachment page rather than the media file in a lightbox.
Thanks for your help anyway 🙂 I’ll keep looking…
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!
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future.— Advanced Custom Fields (@wp_acf) January 6, 2023
© 2023 Advanced Custom Fields.