• Resolved marekbo12

    (@marekbo12)


    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;
                        ?> 
    • This topic was modified 7 years, 3 months ago by marekbo12.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Navneil Naicker

    (@navzme)

    Hi @marekbo12
    Thank you for informing me about this. Let me try and replicate this issue from my side and will advise you soon as possible.

    Thread Starter marekbo12

    (@marekbo12)

    Hi.
    Thank you for the quick reply.
    If you need more information, code or link to my website – please tell me.

    Thread Starter marekbo12

    (@marekbo12)

    Hey @navzme, do you know what is wrong?

    Thread Starter marekbo12

    (@marekbo12)

    Hey.

    I resolved this problem on my own.
    The problem was with Polylang plugin. In Polylang plugin setting was enabled multilingual support for media. This should be turned off. You can do this by unchecking the ‘Activate languages and translations for media’ option, in the settings area of the Polylang plugin. And it works now.

    Plugin Author Navneil Naicker

    (@navzme)

    Hi @marekbo12
    Good to know cheers

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Gallery doesn’t display on some pages.’ is closed to new replies.