Hello,
I am rebuilding an Oxygen powered page, there the code is working fine.
I have an ACF repeater with an image (return array) subfield. I would like now to showcase the image with the caption displayed below.
I have setup an Bricks Query Loop set to the ACF repeater and inserted a code block.
<?php
$bild_querformat = get_sub_field( 'bild_querformat' );
if ( $bild_querformat ) : ?>
<img width="100%" src="<?php echo esc_url( $bild_querformat['url'] ); ?>" alt="<?php echo esc_attr( $bild_querformat['alt'] ); ?>" />
<?php endif; ?>
<?php
$caption = $bild_querformat['caption'];
if( $caption ): ?>
<div class="av-wp-caption-text"><?php echo esc_html($caption); ?></div>
<?php endif; ?>
This approach works fine inside of Oxygen. But on Bricks I now get an error:
Warning : Trying to access array offset on value of type bool in /www/htdocs/w017f3cc/STAGING_Bricks/wp-content/themes/bricks/includes/elements/code.php(160) : eval()'d code on line 9
Any idea what is going on here?
Thanks!