Forums

Polylang
[resolved] Still got one Problem with the home-link (10 posts)

  1. Alexander Albrecht
    Member
    Posted 3 months ago #

    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/

  2. Chouby
    Member
    Posted 3 months ago #

    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.

  3. Alexander Albrecht
    Member
    Posted 3 months ago #

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

  4. Chouby
    Member
    Posted 3 months ago #

    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'));
  5. Alexander Albrecht
    Member
    Posted 3 months ago #

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

  6. abuhaafidh
    Member
    Posted 3 months ago #

    I've had this problem and tried changing to...

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

    ...but I still get the same problem.

  7. Chouby
    Member
    Posted 3 months ago #

    @ 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 ?

  8. abuhaafidh
    Member
    Posted 3 months ago #

    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

  9. Chouby
    Member
    Posted 3 months ago #

    I haven't such power ! I will answer here

  10. Alexander Albrecht
    Member
    Posted 3 months ago #

    Thanks it is solved.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags