Support » Plugin: Polylang » [Plugin: Polylang] Language switch always redirects me to the Front page

  • Resolved Palic


    Thanks a lot for this great plugin !
    I’m starting using wordpress 3.4.2 and downloaded the 0.9.1 version of polylang.

    My problem is that when I use the language switcher, polylang redirects me to the front page ( or instead of redirecting me to the corresponding translated page (mywebsite/?page_id=xx). (not all the pages are translated but all are at least set with the default language)
    Switch between front pages (fr and en) works perfectly but I would like to be able to switch from one page to another without going thru all the translated menu)

    More information :
    I did’nt use the polylang widget : I only added this code in my sidebar

    <!-- option multilingue -->
    <ul><?php pll_the_languages(array('show_flags'=>1,'show_names'=>1,'force_home'=>0));?></ul>
    <!-- -->

    I don’t use custom menu neither : In my header, I use this code to generate the menu and to switch it from french (id6329) to english (id192)

    <ul id="dropmenu">
    <?php if(pll_current_language('slug') == "en"){
    	wp_list_pages('sort_column=menu_order&child_of=192&title_li='); }
    elseif(pll_current_language('slug') == "fr"){
    	wp_list_pages('sort_column=menu_order&child_of=6329&title_li='); }

    I’m a beginner in php and web site development so I’m probably doing something wrong. Can you help me ?

    Many thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby


    your usage of pll_the_languages looks good. Have you a link to your site?

    Thank you Chouby for your quick answer

    My website is
    I’m using the Equilibrium theme.
    You’ll find the french/english switch buttons on the “search zone”

    All the pages of the website are stil not translated
    In the english version, you can go for example to “About us –> Who we are” (
    Then click on the french flag. The page “L’equipe –> qui sommes nous” ( is supposed to appear but instead of it I’m redirected to the french home page.
    In other terms, it almost works but I would like to stay on the same page instead of going back to the front page.

    I’m sure it’s something simple I didn’t notice but my php background is too limited yet to solve it. A question I’m asking to myself for example is how does polylang switch from a page_id to its translated “twin” and reconstructs in the same time the header and the menu ?

    Many thanks for all,

    Plugin Author Chouby


    It’s strange because the translated page is correct in the <head> section, meaning that the pages are correctly linked together and that Polylang is able to find the translation, so should be able to find it again in the switcher.

    I downloaded your theme, made a test with the widget and it works perfect.

    Could you try with the standard language switcher widget (of course, keeping the option “Forces link to front page” unchecked)?

    Hi Chouby.
    It works prefectly now !!! Thanks a lot !

    I tried to insert it as a widget and it worked.
    So I went back to my previous code and noticed that the code

    <!-- option multilingue -->
    <ul><?php pll_the_languages(array('show_flags'=>1,'show_names'=>1,'force_home'=>0));?></ul>
     <!-- -->

    was not inserted inside the widget section below

    <div id="sidebar">
    <?php 	/* Widgetized sidebar, if you have the plugin installed. */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    <!-- Place pll_the_languages inside the widget section and it works -->
    <div class="clear"></div>

    This plugin is wonderful !
    Thanks a lot for your help !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Polylang] Language switch always redirects me to the Front page’ is closed to new replies.