• Resolved A. Albrecht

    (@alexander-albrecht)


    Hi there,

    I’ve installed the latest Polylang plugin on WP 3.3.1 and got only a few subsites translated to other languages. The “home” page is still in english only (the majority of the website is english). For that “home” I’ve got a separate anchor outside my usual navigation. The href attribute is set to “<?php echo esc_url( home_url( ‘/’ ) ); ?>” which should be the “home”.

    But if I’m on a translated page, for example a german one, and then click on my “home”-anchor I will land on http://domain.com/de instead of http://domain.com/

    I do not know what went wrong. The documentation did not help me.

    Are there any suggestions?

    Kind regards
    Alex

    http://wordpress.org/extend/plugins/polylang/

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

    (@chouby)

    This is a desired feature to send the visitor on the German homepage (rather than on the default one) when he is browsing the site in German. Polylang filters the call to home_url( ‘/’ ) to obtain this result.

    Thread Starter A. Albrecht

    (@alexander-albrecht)

    And how do I get around this? Because my homepage is english only.

    Plugin Author Chouby

    (@chouby)

    edit include/core.php at line 97 and replace

    add_filter('home_url', array(&$this, 'home_url'));

    by

    //add_filter('home_url', array(&$this, 'home_url'));

    Thread Starter A. Albrecht

    (@alexander-albrecht)

    Thank you. Hope it will be an option in the future, so that updating the plugin is easier.

    I’ve had this problem and tried changing to…

    //add_filter(‘home_url’, array(&$this, ‘home_url’));

    …but I still get the same problem.

    Plugin Author Chouby

    (@chouby)

    @ Alexander
    There is a better way which will not be overwritten each time you update Polylang. You can add these lines in a personnal plugin (or in the functions.php of a child theme) instead of editing the Polylang file:

    function remove_home_filter() {
    	global $polylang;
    	if ($polylang)
    		remove_filter('home_url', array(&$polylang, 'home_url'));
    }
    add_action('wp', 'remove_home_filter', 99);

    @ abuhaafidh
    Could you describe exactly what is your problem ?

    I’ve posted the question here, but I guess you closed the thread for some reason.

    http://wordpress.org/support/topic/front-page-redirecting-to-default-language-page

    Plugin Author Chouby

    (@chouby)

    I haven’t such power ! I will answer here

    Thread Starter A. Albrecht

    (@alexander-albrecht)

    Thanks it is solved.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Polylang] Still got one Problem with the home-link’ is closed to new replies.