Problem displaying two galleries in one post
-
Hi,
thank you for creating this amazing plugin!
I have an issue with displaying two galleries on one page – first one works like a charm, but the second one won’t show up. The second gallery has images (aka not empty).
Var_dump informs me that the second gallery is an empty array.The code for the first gallery is
if ( $images ) { foreach ( $images as $image ) { $id = $image['id']; // The attachment id of the media $title = $image['title']; //The title $full_image_url= $image['full_image_url']; //Full size image url $full_image_url_square = acf_photo_gallery_resize_image($full_image_url, 300, 300); //Resized to 262pxw 160px h image url $url= $image['url']; //Goto any link when clicked $alt = get_field('photo_gallery_alt', $id); echo '<div class="col-xs-6 col-md-3 col-lg-3">'; echo '<a href="' .$full_image_url . '" target="_blank">'; echo '<img src="' . $full_image_url_square . '">'; echo '</a>'; echo '</div>'; } } echo '</div>';and the second (practicaly the same with renamed variables)
$timages=acf_photo_gallery(tehnicna_galerija, $id); echo $timages; var_dump($timages); echo '<div class="row">'; if ( $timages ) { foreach ( $timages as $image ) { $id = $image['id']; // The attachment id of the media $title = $image['title']; //The title $caption= $image['caption']; //The caption $full_image_url= $image['full_image_url']; //Full size image url $full_image_url_square = acf_photo_gallery_resize_image($full_image_url, 300, 300); //Resized to 262pxw 160px h image url $url= $image['url']; //Goto any link when clicked $alt = get_field('photo_gallery_alt', $id); echo '<div class="col-xs-6 col-md-3 col-lg-3">'; echo '<a href="' .$full_image_url . '" target="_blank">'; echo '<img src="' . $full_image_url_square . '">'; echo '</a>'; echo '</div>'; } } echo '</div>';Best regards
The topic ‘Problem displaying two galleries in one post’ is closed to new replies.