Viewing 5 replies - 1 through 5 (of 5 total)
  • You can add this to your themes functions.php

    // Polylang Shortocde
    function polylang_languages() {
    echo '<ul>';
    pll_the_languages();
    echo '</ul>';
    }
    add_shortcode( 'polylang', 'polylang_languages' );

    Now you can use [polylang] in your posts.

    Thread Starter fearRacious

    (@fearracious)

    Thanks,,,But doesnt worked,,,

    Sorry to hear that, I tested it and it worked for me.

    Maybe some more experienced developer has a better idea (I wouldn’t call this myself)

    Hi @bej-soan,

    Could you share what have you done after add the code to function.php???
    any other set up process?

    Thanks..

    Hi,

    I just wrote this code to my functions.php and used the shortcode in the post editor like a regular shortcode. It did return all of my languages as list.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add polylang on the top menu’ is closed to new replies.