• phidotee

    (@phidotee)


    Hi,

    I am using the plugin in parallel for images inserted from Gutenberg and also from custom ACF block using the following template:

    in function.php

    add_filter( 'baguettebox_enqueue_assets', '__return_true' );
    add_filter( 'baguettebox_selector', function( $selector ) {
        return $selector . ',.product-gallery';
      }
    );

    in template:

    <div class="product-gallery">
        <a class="product" style="background-image: url(<?php echo esc_url($thumb); ?>)" href="<?php echo esc_url($fullimg); ?>">
            <figcaption>
                <p><strong><?php the_sub_field('name'); ?></strong></p>
                <?php the_sub_field('description'); ?>
            </figcaption>
        </a>
    </div>

    While the images work fine, the caption for all images is the same.

    I also tried to show caption suing the title tag and data-caption for the element, but these did not work.

    Any ideas how to show the correct caption per image?

    Best regards,
    Verner

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Same caption displayed to all images’ is closed to new replies.