Support

Account

Home Forums Add-ons Gallery Field ACF Gallery vs WPML Reply To: ACF Gallery vs WPML

  • Hello MarekR.

    I’ve fond a small hack.

    Because the pictures are the same in both language this little snippet will get the images from the default language.

    global $sitepress;
    $current_language = $sitepress->get_current_language();
    $default_language = $sitepress->get_default_language();
    $sitepress->switch_lang($default_language);
    $images = get_field(‘album_photo’);
    $sitepress->switch_lang($current_language);
    $imagesCount = count($images);

    Cheers