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/
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.
Alexander Albrecht
Member
Posted 3 months ago #
And how do I get around this? Because my homepage is english only.
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'));
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.
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.
@ 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 ?
abuhaafidh
Member
Posted 3 months ago #
I haven't such power ! I will answer here
Alexander Albrecht
Member
Posted 3 months ago #