WP 3 Menu: Link to Homepage redirects to default language

Having Problems? Need Help? Post here!

WP 3 Menu: Link to Homepage redirects to default language

Postby Thomas Krüger » Sat Jul 31, 2010 9:43 pm

Just curious, adding the homepage link to the Wordpress 3 menu the "Home" link will always redirect to the homepage in the default language. Pages and category links are working fine, only the link to the homepage is driving me nuts. :twisted:

Is there perhaps a workaround?
Thomas Krüger
 
Posts: 34
Joined: Sat Sep 19, 2009 5:31 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby ppivec » Sun Aug 01, 2010 7:34 am

I know how you feel.
This posting is the same issues.
http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=1627
ppivec
 
Posts: 8
Joined: Thu Jul 29, 2010 11:24 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby ppivec » Sun Aug 01, 2010 7:53 am

Clicking on the header (Banner) works fine and takes the user back to the home page without changing the language.
I presume that it does a qtranslate query because the url has the lang= in it.
Perhaps the WP3 custom menu item could be pointed to the same place as the header?
Perhaps point the home url to a .php that does a qtranslate query?
Any php experts out there?
:?
ppivec
 
Posts: 8
Joined: Thu Jul 29, 2010 11:24 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby Thomas Krüger » Sun Aug 01, 2010 10:13 am

I think there is no solution because the WP menu uses a simple link to the homepage, see the screenshot. Or hacking something in the files wp-includes/nav-menu.php or wp-includes/nav-menu-template.php.

Anyway, clicking on the banner works.

WP_menu.jpg
Thomas Krüger
 
Posts: 34
Joined: Sat Sep 19, 2009 5:31 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby ppivec » Mon Aug 02, 2010 10:41 am

Okay, this appears to work just fine.

Create a page titled "Home".

Under settings/reading, set Post page to Home, and leave front page to "select" (ie: dont set it).
But , set front page to "static".

Under Appearance/Menus, select Home as the first menu entry (being Home).

Save.

I
Selecting another language and clicking home or the heading stays in that language.

Coming into the page from the base URL, defaults to the Posts page which is "Home" and in the default language.

At least it os working for me :D
ppivec
 
Posts: 8
Joined: Thu Jul 29, 2010 11:24 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby Thomas Krüger » Mon Aug 02, 2010 12:44 pm

Got it working, thanks! ;) - but it messed up the Yoast Breadcrumbs... :(
Will try another time after the holidays....
Thomas Krüger
 
Posts: 34
Joined: Sat Sep 19, 2009 5:31 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby envision » Wed Aug 25, 2010 1:19 am

Thanks for that idea! I'm using it for now although it's not ideal because the browser URL field now says
Code: Select all
example.com/de/home/

instead of just
Code: Select all
example.com/de/


Any way to have it show the "real" home URL?

I guess this is related to viewtopic.php?t=1666
envision
 
Posts: 13
Joined: Mon Jul 26, 2010 2:22 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby Thomas Krüger » Thu Aug 26, 2010 4:20 pm

Another try with a template from one of my WP themes, and this one seems to work using the nav menu of WP 3.01. Credits go to the coders of http://www.woothemes.com
Creating a page with a redirect template you can fill in the links to the homepage in the relative language.
Code: Select all
<?php
/*
Template Name: Redirect
*/
?>

<?php
/*

USAGE INSTRUCTIONS:

1. Create a new page in WordPress
2. Add a title to the page (e.g. WooThemes)
3. Add an URL to the content of the page (e.g. http://www.woothemes.com OR woothemes.com OR www.woothemes.com)
4. Select "Redirect" as the page template
5. Publish!

*/
?>

<?php if (have_posts()) : the_post(); ?>
<?php $URL = get_the_excerpt(); if (!preg_match('/^http:\/\//', $URL)) $URL = 'http://' . $URL; ?>

<!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">
<head>
<meta http-equiv="Refresh" content="0; url=<?php echo $URL; ?>">
</head>

<body>
</body>
</html>

<?php endif; ?>
                  
Thomas Krüger
 
Posts: 34
Joined: Sat Sep 19, 2009 5:31 am

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby rukus » Fri Oct 01, 2010 7:59 pm

Hi Thomas,

I created the template "Redirect", but not sure I understand on what page to apply it on, or where to place the language URL. Would you mind providing the steps you took to make it work on your site?

Thank you,
Mike
rukus
 
Posts: 1
Joined: Fri Oct 01, 2010 7:57 pm

Re: WP 3 Menu: Link to Homepage redirects to default language

Postby tamerax » Tue Oct 05, 2010 10:22 am

Other than using the redirect template, is there any hack to hardcode a Home link that can be translated into the nav-menu files so we can still use the 3.0 menus?
tamerax
 
Posts: 2
Joined: Tue Oct 05, 2010 10:18 am

Next

Return to qTranslate Support Forum

Who is online

Users browsing this forum: Google [Bot] and 3 guests