• Resolved bbbelleville

    (@bbbelleville)


    Hello everybody,
    I would like to move the language switcher from menu to the header of theme. I’ve tryed writing this in the header.php:

      <?php pll_the_languages(array(‘show_flags’=>1,’show_names’=>0)); ?>

    and the flags show, but creating an empty section in the theme.
    I’ve tryed then to move it through CSS, but flags are limited in this empty section.
    Where do I go wrong? Thanks for a great help!
    Paola

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter bbbelleville

    (@bbbelleville)

    I’ve finally done! I did like this:
    In function.php:

    function polylanguage_shortcode() {
    ob_start();
    pll_the_languages(array(‘show_flags’=>1,’show_names’=>0));
    $flags = ob_get_clean();
    return $flags;
    }
    add_shortcode( ‘polylanguage’, ‘polylanguage_shortcode’ );

    And in the header, before the tag </head>:

    <div class=”polylanguage flags”<?php echo polylanguage_shortcode(); ?>

    </div>

    Finally some CSS rules, and it’s all!

Viewing 1 replies (of 1 total)

The topic ‘moving the language switcher’ is closed to new replies.