• Resolved Serge Boyko

    (@boykodev)


    I am using ACF gallery field to create a slider to be displayed on both language versions of a page.

    I can access this field, with this function:
    get_field('gallery');
    from a page with default language no problem, but wasn’t able to do it on the translated page – it returns an empty array.

    The strange part is that I can’t get gallery field from a translated page even if I use the id of the page with default language, like so:
    get_field('gallery', $page_id);

    Even more strange – I created a gallery field in ACF ‘Option page’, and have no problem to access it from page with default language, using this:
    get_field('gallery', 'options');
    But on the translated page this function still returns an empty array.

    I must say there is no problem to access any other ACF field from translated page, but only gallery field.

    Why is that gallery field have this issue, but not any other type of ACF fields?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Serge Boyko

    (@boykodev)

    Calling get_field('gallery', 'options', false); on translated page returned array of image ids. Issue is probably connected with applying filters, but why only on the translated page?

    I’m experiencing the same problem as well.
    Strange thing is also that on database checking post_meta they’re stored in the right way.
    Did you find any solution?

    Thread Starter Serge Boyko

    (@boykodev)

    Try to turn off mediafiles translation in Polylang settings.
    I decided not to use gallery field at all.
    Let me know if it worked.

    In the end I switched to qTranslateX since I was having too much problems with custom post types / taxonomies slugs.. thank you!

    Just ran into this problem myself and was pretty confused as to why my ACF gallery arrays were returning empty on translated pages only. I can confirm the problem exists when the gallery field is applied to both normal and options pages.

    While not optimal, turning off media file translations in Polylang resolved the issue. The problem definitely resides there. This is the only issue I found when using ACF and Polylang together.

    @chouby, any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can't get access to ACF gallery field from a translated page.’ is closed to new replies.