我希望根据添加参数来翻译我的wordpress页面?lang = de_DE。
下面是我的index.php文件:
<!DOCTYPE HTML>
<html<?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<?php wp_head(); ?>
</head>
<body>
<h1> <?php echo __('This is our website','basictheme');?> </h1>
<?php wp_footer(); ?>
</body>
</html>
functions.php文件
<?php
function basictheme_functions() {
load_theme_textdomain('basictheme',get_template_directory_uri().'/lang');
add_theme_support('title-tag');
register_nav_menus(array(
'main-menu' => __('Main Menu','basictheme'),
'footer-menu' => __('Footer Menu','basictheme'),
));
}
add_action('after_setup_theme','basictheme_functions');
?>
将参数添加到网址时,如何翻译页面。
(例如http://localhost/about/?lang=de_DE
)