Home link goes to default language


Author Message
Mrs. T.

Posted: 2/26/2010
Quote message 

I've set up wordpress to show a static page for the home page with the English title as "Home" and the French title as "Accueil". The title tag in the menu appears correctly for both languages, but when viewing the English site, if we click on the "Home" button it goes back to the French language front page. I thought that static pages would correctly direct to the correct language even if it is called Home. I searched many forums and some suggested to change get_option('home') to bloginfo('url') in the header.php, but I don't have this code anywhere in my header created by Artisteer.

Pls. help. :(
 
Adeptris

Posted: 2/26/2010
Quote message 

The menu is set in functions.php and the get_option('home') is in a function look for the line 'function art_print_homepage()'

and the get_option home code is within the code block

David
 
Mrs.T.

Posted: 2/26/2010
Quote message 

I looked for the "function art_print-homepage()" in functions.php and it is not there.

I have only two places where get_option('home') is and the first one in in "function art_list_pages_filter($output)" and the second one is in "function art_menu_items()".

When I change the first one - the home page link is being printed on top of my menu bar and the menu bar is shifted lower on the page. And when I change the second one, nothing at all happens.
 
Adeptris

Posted: 2/26/2010
Quote message 

You have an earlier created version pre 2.4, where it is in the function:

art_menu_items()

Search for
. get_option('home') .

between the periods
. bloginfo('url') .

Replace both instances, if that does not work then :-(

David
 
Mrs.T.

Posted: 3/5/2010
Quote message 

:-)Hurray.....! I found the solution. For those using qTranslate plugin, this is what I did:

In functions.php, find this code under - function art_list_pages_filter($output)

if ($frontID)
$output = preg_replace('~<li class="([^"]*)\b(' . $pref . $frontID . ')\b([^"]*)"><a href="([^"]*)" ~',
'<li class="$1$2$3"><a href="'. get_option('home') .'" ', $output, 1);

and replace it with:

if ($frontID)
$output = preg_replace('~<li class="([^"]*)\b(' . $pref . $frontID . ')\b([^"]*)"><a href="([^"]*)" ~',
'<li class="$1$2$3"><a href="'. qtrans_convertURL(get_option('home')) .'" ', $output, 1);

Anyway, this is working like a charm for me and the Home link is now going to the right language.
 
Mrs.T.

Posted: 3/5/2010
Quote message 

It can also be changed in - function art_menu_items()

In case you don't have it in the first function (older versions of Artisteer).
 
marsviolet

Posted: 4/3/2010
Quote message 

But what if you are already committed to "xLanguage" plugin?

Does anybody have a solution for this?

I do not know much about writing PHP, but I can get with instructions.

thanks
 
Nick L W

Posted: 6/15/2010
Quote message 

THANKS A MILLION MRS. T.

I've been searching for an answer for ages in the qTranslate Forum. I never though to look in the Artisteer forum!

I'd jut about given up with the well meaning boffins at qTranslate that only talk in computer-speak and suggest solutions that I can't begin to understand.

I've taken the liberty of crediting you in the forum strand. The forum is:
qTranslate Suggestions Forum
Title: Clicking on the Title/Home-Link resets selected language.
 
Toomas

Posted: 11/10/2010
Quote message 

Same problem if you use WPML Wordpress 3.01 and Artisteer 2.5 gen theme. Then in navigation.php change in two places:

url: get_option

to

get_home_url()

And it works perfect.

P.S. I think in artisteer there are different costumer service peoples. Some gives good solutions and others not :)
 
Henk Hogeveen

Posted: 12/13/2010
Quote message 

Hi Toomas

I'm using Artisteer 2.5.0.31067 Standaard on WP 3

Did not find url: get_option
in navigation.php

USING WPML as language plugin and only home link is not automaticallly changed to right language
 
Henk Hogeveen

Posted: 12/23/2010
Quote message 

Quote Toomas:

Same problem if you use WPML Wordpress 3.01 and Artisteer 2.5 gen theme. Then in navigation.php change in two places:

url: get_option

to

get_home_url()

And it works perfect.

P.S. I think in artisteer there are different costumer service peoples. Some gives good solutions and others not :)


Thks toomas.

It worked out in this piece of code in core/navigation.php
$href = get_page_link($page->ID);
if ($this->frontID && $this->frontID == $page->ID) {
//$href = get_option('home');
$href = get_home_url();
 
Jeroen

Posted: 5/26/2011
Quote message 

In navigation.php I want to replace the get_option code in two places (like Toomas wrote).

However I found thid code on 9 different places. Which 2 places have to be replaced?

 
Jeroen

Posted: 5/26/2011
Quote message 

I get it:

In navigation.php

Change:
get_option('home')

to:
qtrans_convertURL(get_option('home'))

(twice)
 
NickLW

Posted: 2/1/2012
Quote message 

Thanks Jeroen

I'm using Artisteer 3.1.0.45075 with Wordpress 3.3.1

Just tried your advice above.

But I only found one
get_option('home')

in navigation.php

So I couldn't do it twice. However, it seems to be working ... so good news!

Cheers
 
John Smith

Posted: 11/3/2020
Quote message 

Hi, guys! I should say that it is awesome that now a lot of people can speak at least two languages! I work as a web developer. English is not my native language but I can easily make business with clients from all over the world! By the way, if you want to learn any new language or improve yours - I would truly recommend you to check out this list of top apps for language exchange https://preply.com/en/blog/language-exchange-app/!