Home page link
The normal practice for creating a link to the home page is to insert this in the theme (normally in header.php):
<a href="<?php echo get_option('home'); ?>/"
What this does is construct a link that points to your site’s ‘home’ address. Since that address is stored in WordPress without a trailing ‘/’, this code also adds that ‘/’. Without it, WordPress would redirect internally, causing a double access for every click on the home page.
When you’re using WPML, the home page address is modified per language. Some addresses would already contain the trailing ‘/’ and others not. If you keep the normal home page link, you’ll get double ‘/’ signs for some of the home pages. For example:
example.com/es//
To avoid this, replace the home page link with this:
<a href="<?php echo icl_get_home_url() ?>"
This is a URL which WPML calculates for the home page. It’s always correct and doesn’t require the additional of an optional trailing slash.
English
简体中文
Deutsch
日本語
Español