Support

Account

Home Forums Add-ons Gallery Field Wrong Gallery order in other languages

Solving

Wrong Gallery order in other languages

  • I have a gallery in options page. In the main language displays the correct order in front page. The problem is that in secondary languages it shows images in alphabetic order. Should display images in custom gallery order as usual.

    I’m using ACF PRO 5.2.5 and WPML 3.1.9.5

    This also happen with the gallery in a page. I moved to options in order to solve it but didin’t work.

    This is the PHP code for the gallery.

    <?php //galeria
    $images = get_global_option(‘logos_clientes’);
    if( $images ): ?>

    <div class=”logosclientes”>

    <?php foreach( $images as $image ): ?>
    <div class=”logo”>
    ” alt=”<?php echo $image[‘alt’]; ?>” />
    </div>
    <?php endforeach; ?>

    </div>

    <?php endif; ?>

  • Hi @vueloiv

    Could you also post your get_global_option function?
    The issue would be in there somewhere I believe.

    • bnbc

    • July 27, 2015 at 10:45 pm

    Hello, i have the same problem :

    
    <?php
        $galerie = get_field('galerie');
        print_r($galerie);
    ?>
    

    In my main language front page order is equal to admin order, and in my other languages order is not equal to admin, order changes are ignored.

  • Hi @bnbc

    So you’ve tried changing the order on a translated page and it still shows the images in alphabetical order instead?

    If possible, could you try switching your main language and see if the issue appears on the old main language and disappears on the new main language?

    • bnbc

    • July 28, 2015 at 10:32 pm

    Yes for your first point.

    I did your test, i passed my main language to EN and it’s ok for all languages ! the issue disappears and order is ok for all.

    But when i reset my main language to FR the EN order is again not ok.

  • Ah okay.. interesting. That means the issue lies in having a different main language than english.

    And you’re using the latest version of WP, WPML and ACF? ACF 5 or 4?

    • bnbc

    • July 30, 2015 at 7:48 pm

    Yes that’s it.

    WP (4.2.3), WPML (3.2.2) and ACF (5.2.8) are up to date.

  • I’ll include @elliot in the conversation so he can determine if this is a bug that should be fixed in ACF 🙂

    • bnbc

    • August 5, 2015 at 7:36 pm

    Hello, some news with this issue ?

    Thks !

    • bnbc

    • August 6, 2015 at 8:32 pm

    Hi, i have some news and manual fix !

    The problem is when i duplicate a post with a gallery field and i use the button “Overwrite with FR content”, images in the gallery (in EN post) are the FR images and not the EN duplicated images.

    So to fix the issue i have to delete the images in the gallery and click on the “Add to gallery” button to select again the good images (EN duplicated images).

    Do you think this action can be automated ? by ACF or WPML ?

    Sorry for my english…

  • Hi @bnbc

    Ah I see so that’s the issue. It’s hard to say where the “blame” falls exactly but my personal opinion is that WPML when copying content should also copy the images to the language and fix this themselves.

  • Same problem here! Need to talk with WPML team?

    In my case calling to field and forcing original post no solved the problem:

    USING THIS

    $id = icl_object_id($v['wp']->ID, 'property', true, ICL_LANGUAGE_CODE);
    $img = get_field('galeria',$id);

    AND THIS

    $id = icl_object_id($v['wp']->ID, 'property', true, "en");
    $img = get_field('galeria',$id);

    OR THIS

    $id = icl_object_id($v['wp']->ID, 'property', true, "es");
    $img = get_field('galeria',$id);

    In this 3 cases, order is correct in main language (es) and incorrect in others.

  • UPDATE:

    The trick from webloft here: http://support.advancedcustomfields.com/forums/topic/acf-gallery-vs-wpml/ works for me.

  • Hi Carlos

    Yeah it works since he’s fetching the images from the main language instead. A decent workaround but it does require some unnecessary stuff going on and makes translating alt tags etc hard to do.

    My opinion is still to nag at the WPML team to fix the duplication process so it includes images since that seems to be the root of the problem.

  • Thanks for your reply, but seems they aren’t interested in this integration:
    https://wpml.org/forums/topic/wpml-cms-and-acf-gallery/

    For now, this works for me, although I know that’s not the optimal solution

  • Well there you go. In my experience that’s generally the response you get from WPML.. not their biggest fan tbh 🙂

    Perhaps checking to translate media in WPML settings makes some magic happen?

    • kurtko

    • September 29, 2015 at 8:26 pm

    Hi,

    I have the same proble. Any news about this?

    Thanks.

  • Hello, I have the same problem.

    The point is that the translated gallery don’t change the order even manually.

Viewing 18 posts - 1 through 18 (of 18 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.