问题描述
我使用 polylang 插件作为我网站的多语言解决方案。
在我的菜单中,我使用带有 Elementor 构建器的 polylang 小部件。在 wordpress 中制作的经典 polylang 菜单中,您可以添加 polylang 小部件切换器,您可以在其中选择仅显示标志的选项。问题是我不使用菜单小部件切换器,因为我不想在我的标题的自定义列中显示带有菜单项的切换器。
我使用侧边栏中使用的 Elementor 小部件。但是侧边栏小部件切换器没有仅在下拉菜单中显示标志的选项。它只显示语言名称,没有显示标志的选项。 我需要做的是仅在我的自定义小部件中显示标志。
我也试过这段代码,但它也只显示语言名称而不是标志。
function custom_polylang_langswitcher() {
$output = '';
if ( function_exists( 'pll_the_languages' ) ) {
$args = [
'show_flags' => 1,'show_names' => 0,'echo' => 0,'dropdown' => 1,];
$output = '<ul class="polylang_langswitcher">'.pll_the_languages( $args ). '</ul>';
}
return $output;
}
add_shortcode( 'polylang_langswitcher','custom_polylang_langswitcher' );
预先感谢您的帮助。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)