Support

Account

Forum Replies Created

  • Hi, did you find any use of my reply? 🙂

  • You should not change any field but your image field.

    Inside your ACF setup, you would have a field called post_slider_images (probably a Repeater field), and inside that you would have an image subfield called post_slider_image.

    On that post_slider_image field, you should simply change “Return value” to “Image Array”. See this image

    If it is a repeater field (post_slider_images) with a subfield (post_slider_image), your code for printing the image should then look like this:

    <div class="gallery cycle-slideshow clearfix" data-cycle-timeout="6000">
        
        <?php if(have_rows('post_slider_images')): ?>
    		<?php while(have_rows('post_slider_images')): the_row(); ?>
    		
    	        <?php $image_data = get_sub_field('post_slider_image'); ?>
    	        <img src="<?php echo $image_data['url']; ?>" alt="<?php echo $image_data['alt']; ?>" />
    	        
    	    <?php endwhile; ?>
    	<?php endif; ?>
       
    </div>
  • Hi

    As you can see you haven’t inserted an alt text in your code:
    <img src="<?php the_sub_field('post_slider_image');?>">

    So you would need that. What return value are you using in your image field settings? Must be URL. So you would need to change that into “Image Array”.

    In your code you would define the image as:
    <?php $image = get_sub_field('image'); ?>

    And print it out like:
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />

    Also, the has_sub_field function is outdated, see:
    https://www.advancedcustomfields.com/resources/has_sub_field/

    have_rows was added in 4.3.0:
    https://www.advancedcustomfields.com/resources/have_rows/

  • OK, solved my problem. I don’t know if this is the same as yours, but will write my solution anyways. I am using WPML and ACF.

    When duplicating/translating my field group to the second language, it couldn’t find and match my clonefield settings choise on the other language – even though that the clonefield field group itself was already duplicated/translated to second language – resulting in “Unknown” as setting.

    The clonefield it self is only shown by conditional logic, and when it had “Unknown” as clonefield settings choise, it resulted in a JS bug, as you describe.

    When changing the duplicated/translated field group settings, so that the clonefield now looks at the duplicated/translated clonefield field group, it all works.

    🙂 Rasmus

  • Was this solved? Currently experiencing what I think is the same error.

Viewing 5 posts - 1 through 5 (of 5 total)