多语言的wordpress前端页面部分
问题描述:
今天我在wordpress的首页部分有问题。多语言的wordpress前端页面部分
我使用polylang,当我在页面上更改语言时,我的页面使用不好的语言(默认语言)。
例如: 我的默认语言为波兰语,波兰的用户,我展示的文字:
KONTAKT
当我改变语言为英语,我可以看到:
联系人
但此刻我看到了不好的结果,我可以看到:
KONTAKT
我用模板二十七,polylang。
非常感谢您的回复。
答
我做到了。我编辑它看起来像这样
function acousticquartet_front_page_section($partial = null, $id = 0) {
if (is_a($partial, 'WP_Customize_Partial')) {
// Find out the id and set it up during a selective refresh.
global $acousticquartetcounter;
$id = str_replace('panel_', '', $partial->id);
$acousticquartetcounter = $id;
}
global $post; // Modify the global post object before setting up post data.
if (get_theme_mod('panel_' . $id)) {
global $post;
if(pll_get_post(get_theme_mod('panel_' . $id))):
$id = pll_get_post($id = get_theme_mod('panel_' . $id));
else:
$id = get_theme_mod('panel_' . $id);
endif;
$post = get_post($id);
setup_postdata($post);
set_query_var('panel', $id);
get_template_part('template-parts/page/content', 'front-page-panels');
wp_reset_postdata();
} elseif (is_customize_preview()) {
// The output placeholder anchor.
echo '<article class="panel-placeholder panel acousticquartet-panel acousticquartet-panel' . $id . '" id="panel' . $id . '"><span class="acousticquartet-panel-title">' . sprintf(__('Front Page Section %1$s Placeholder', 'acousticquartet'), $id) . '</span></article>';
}
}
当我没有翻译文件中的文件
模板/ INC /模板tags.php
,并在那一刻我的* _front_page_section,我的代码显示默认语言。