Home page reverts to default language

Having Problems? Need Help? Post here!

Home page reverts to default language

Postby Ian W. » Mon Jan 11, 2010 11:24 pm

First of all this is a great plug-in. Thx.
I've seen a lot of posts in this forum about the "home page" which reverts back in the original language.
I have this problem with my site.
I noted that it is the "static page" chosen in the "Reading settings" of WP which always reverts back to the original language chosen in the "General settings" of qTranslate.
Any idea what I can do so that the home page stays in the language chosen ?
If I have to change some code can you tell me which file to change. I am a newbie in WP and know no CSS ( I use Artisteer 2).
Thx.
Ian W.
 
Posts: 1
Joined: Mon Jan 11, 2010 11:15 pm

Postby Number Nine » Sat Feb 06, 2010 9:39 am

Actually, this is my problem, too, and I am looking for a solution.

In practical terms, if you use your Wordpress site as a commercial site, this situation is quita annoying. The English visitor navigates the site, and when he / she decides to go back to the home page the italian version (in my case) is shown.

I think this aspect concerns many of us, doesn't it?
Number Nine
 
Posts: 3
Joined: Fri Feb 05, 2010 4:21 pm

Re: Home page reverts to default language

Postby Eviternity » Sat Feb 06, 2010 10:59 am

Check this website.
The problems lies in the call of the URL from the WP theme. Change in the editor the header of your theme get_option('home') into bloginfo('url').

http://themeshaper.com/forums/topic/get_optionhome-should-be-bloginfourl
Eviternity
 
Posts: 3
Joined: Fri Jan 29, 2010 6:42 pm

Re: Home page reverts to default language

Postby theresel » Fri Feb 26, 2010 6:22 pm

And what if we don't have the get_option('home') in our header file?? Can it be in functions.php??
theresel
 
Posts: 12
Joined: Fri Feb 26, 2010 6:20 pm

Re: Home page reverts to default language

Postby flip flop » Mon Mar 01, 2010 10:57 am

Could you post the code-snippet from your header.php:
need from .... to this:
<ul id="example_navigation"> ... </ul>
flip flop
 
Posts: 4
Joined: Sun Feb 28, 2010 11:53 am

Re: Home page reverts to default language

Postby theresel » Mon Mar 01, 2010 8:45 pm

Here's my header code. As you'll see, I've added my modifications. The theme was made with Artisteer.
==================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); if(get_bloginfo('name') != "") echo ' - ' ; bloginfo('name'); }
elseif (is_single() ) { single_post_title(); }
elseif (is_page() ) { bloginfo('name'); if(get_bloginfo('name') != "") echo ': '; single_post_title(); }
else { wp_title('',true); } ?></title>
<meta name="keywords" content="carnaval, hearst, ontario, carnival, hearst, ontario" />
<meta name="description" content="Carnaval d'hiver de Hearst, Ontario. Hearst, Ontario Winter Carnival." />
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
<link rel="stylesheet" href="http://www.carnavalhearstcarnival.com/wp-content/themes/CarnavalLarge2/print.css" type="text/css" media="print" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie7.css" type="text/css" media="screen" /><![endif]-->
<link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<?php wp_head(); ?>
<script type="text/javascript">
function bookmark_us(url, title){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
</head>
<body>
<div id="art-page-background-glare">
<div id="art-page-background-glare-image"></div>
</div>
<div id="art-main">
<div class="art-Sheet">
<div class="art-Sheet-tl"></div>
<div class="art-Sheet-tr"></div>
<div class="art-Sheet-bl"></div>
<div class="art-Sheet-br"></div>
<div class="art-Sheet-tc"></div>
<div class="art-Sheet-bc"></div>
<div class="art-Sheet-cl"></div>
<div class="art-Sheet-cr"></div>
<div class="art-Sheet-cc"></div>
<div class="art-Sheet-body">
<div class="art-Header">
<div class="art-Header-jpeg">
<table id="tabletopheader" width="6%" border="0" cellspacing="0" cellpadding="3">
<tr valign="middle" align="center">
<td><a href="javascript:bookmark_us('http://www.carnavalhearstcarnival.com','Carnaval de Hearst Carnival')"><img src="http://www.carnavalhearstcarnival.com/wp-content/themes/CarnavalLarge2/images/favorites.gif" width="16" height="16" border="0"></a>

</td>

<td><a href="javascript:window.print()"><img src="http://www.carnavalhearstcarnival.com/wp-content/themes/CarnavalLarge2/images/printer.gif" width="16" height="16" border="0"></a></td>

</tr>

</table>
</div>
</div>
<div class="art-nav">
<div class="l"></div>
<div class="r"></div>
<ul class="art-menu">
<?php art_menu_items(); ?>
</ul>
</div>
theresel
 
Posts: 12
Joined: Fri Feb 26, 2010 6:20 pm

Re: Home page reverts to default language

Postby blackbookdesign » Tue Mar 02, 2010 2:08 am

Tien un Ontarien! :P

I guess this is in relation with your wp_list_pages or wp_list_categories. Usually they have a home page link before that code. Check into that.
If not call in your home link with
Code: Select all
<a href="<?php bloginfo('url') ?>/"  tiitle="home"/>home</a>

Note that home isn't "multi-linguizised". (new word here)
just place it in the header and test it out.
blackbookdesign
 
Posts: 25
Joined: Tue May 19, 2009 10:13 pm

Re: Home page reverts to default language

Postby flip flop » Tue Mar 02, 2010 12:02 pm

hi,

i think - your code for the navigation is in this plugin? or theme?-snippet:

<ul class="art-menu">
<?php art_menu_items(); ?>
</ul>

look for this code "art_menu_items" in your theme or plugin files and post it here
flip flop
 
Posts: 4
Joined: Sun Feb 28, 2010 11:53 am

Re: Home page reverts to default language

Postby theresel » Tue Mar 02, 2010 12:42 pm

The code for the "art-menu-items" is in my functions.php file for the theme. I found two instances of the get_option('home') in that file, the first one is in this function (in bold):

function art_list_pages_filter($output)
{
global $artThemeSettings;
$pref ='page-item-';
if($artThemeSettings['menu.topItemIDs'])
foreach($artThemeSettings['menu.topItemIDs'] as $id){
$output = preg_replace('~<li class="([^"]*)\b(' . $pref . $id . ')\b([^"]*)"><a ([^>]+)>([^<]*)</a>~',
'<li class="$1$2$3"><a $4>' . $artThemeSettings['menu.topItemBegin']
. '$5' . $artThemeSettings['menu.topItemEnd'] . '</a>', $output, 1);
}

$frontID = null;
$blogID = null;
if('page' == get_option('show_on_front')) {
$frontID = get_option('page_on_front');
$blogID = $artThemeSettings['menu.blogID'];
}
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);

if ((is_home() && $blogID) || $artThemeSettings['menu.activeID'])
$output = preg_replace('~<li class="([^"]*)\b(' . $pref . (is_home() ? $blogID : $artThemeSettings['menu.activeID']) . ')\b([^"]*)"><a ~',
'<li class="$1$2$3"><a class="active" ', $output, 1);
return $output;
}

===============================================
AND the second one is in this function (in bold):
===============================================

function art_menu_items()
{
global $artThemeSettings;
if (true === $artThemeSettings['menu.showHome'] && 'page' != get_option('show_on_front'))
echo '<li><a' . (is_home() ? ' class="active"' : '') . ' href="' . get_option('home') . '">'.$artThemeSettings['menu.topItemBegin']
. $artThemeSettings['menu.homeCaption'] . $artThemeSettings['menu.topItemEnd'] . '</a></li>';
add_action('get_pages', 'art_header_page_list_filter');
add_action('wp_list_pages', 'art_list_pages_filter');
wp_list_pages('title_li=&sort_column=menu_order');
remove_action('wp_list_pages', 'art_list_pages_filter');
remove_action('get_pages', 'art_header_page_list_filter');
}

=====================================================

I tried changing both to bloginfo('url') - but when I change the first one, the link for the home page is printed on top of my art-menu and the menu is shifted down on the page. When I change only the second one, nothing happens.... :?

I hope someone can help me.
theresel
 
Posts: 12
Joined: Fri Feb 26, 2010 6:20 pm

Re: Home page reverts to default language

Postby theresel » Tue Mar 02, 2010 12:51 pm

Hi blackbookdesign, oui un ontarien

I tried your suggestion and inserted the link in my footer to test. It seems to be working for both languages, but if I do that I would have to hard code the Home link into my menu and drop it from the main menu, and I don't know how to do that.
theresel
 
Posts: 12
Joined: Fri Feb 26, 2010 6:20 pm

Next

Return to qTranslate Support Forum

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 4 guests