Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1491394

    Hi,
    I have a problem and maybe somebody can help.
    I use the plugin Gtranslate everything works on desktop view but in mobile view there is no flag in the menu.
    Maybe somebody knows the problem and can help me?
    Thank you and best regards

    #1491440

    Hey walhai,

    Thank you for the update.

    The theme doesn’t natively support the translation plugin, but you can try this script in the functions.php file to move the translation flags inside the mobile menu.

    add_action('wp_footer', function() {
        ?>
        <script>
        jQuery(function($) {
            function moveGTranslate() {
                if ($(window).width() <= 768) {
                    var targetLi = $('.menu-item-3651.av-active-burger-items');
                    if (!targetLi.find('.gtranslate_wrapper').length) {
                        var gtranslate = $('.gtranslate_wrapper');
                        if (gtranslate.length && targetLi.length) {
                            gtranslate.appendTo(targetLi);
                        }
                    }
                }
            }
    
            moveGTranslate();
    
            $(window).on('resize', moveGTranslate);
        });
        </script>
        <?php
    }, 999);
    

    Best regards,
    Ismael

    #1491452

    Thank you very much for your help.
    It partially works. When I open the mobile view the flags are not visible but when I rotate the mobile the flags appear?
    I tried to change the window width but it does not work.
    Any idea??
    Thank you and regards

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.