Gallery doesn’t display on some pages.
-
I added 2 months ago acf_photo_gallery to single portfolio template, everything worked properly. Now, I notice that some of portfolio products doesn’t display gallery. In edit portfolio in WP images are added, but on front site gallery is empty.
The problem is that on some portfolio products var_dump() function displays empty array (and gallery is empty), but on some portfolio products Array has elements and gallery displays properly. If I add new images to gallery, that does not display – they show up, but only the new ones. I don’t know why, maybe the problem is in Database? WP_DEBUG and browser console nothing displays.My code to display gallery in single_portfolio.php template:
<?php $images = acf_photo_gallery('gallery_images', $post->ID); if( count($images) ): foreach($images as $image): $full_image_url= $image['full_image_url']; $class = get_field('gallery_images_class', $image['id']); /// musi by? $image['id'] ! echo '<img src="'.$full_image_url.'" class="item filter-'.$class.'" >'; endforeach; endif; ?>
- The topic ‘Gallery doesn’t display on some pages.’ is closed to new replies.