admin管理员组

文章数量:1125497

Now when I’m on an internal page of the italian version if I select “deutsch” I land to the home page in german. Is it possible landing to the same internal page in german? my website:test.sacconicase In wp-config.php I have

define( 'WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);

define( 'WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);

all German internal page slugs are the same as Italian page slugs. I wonder if I have to change this code in functions.php:

add_filter('locale', 'lang_by_subdomain');
function lang_by_subdomain( $lang ) {

if (0 === strpos( $_SERVER['HTTP_HOST'], 'de.')) {
  // set to German
  return 'de_DE';


} else {
  // return original language
  return $lang;


}

}

本文标签: phphow switching from italian to german from internal to internal URL