获取WPML的语言代码 [英] Get language code of WPML
本文介绍了获取WPML的语言代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试获取 WPLM wordpress 插件的语言代码.这就是我不走运的做法:
I'm trying to get the language code of the WPLM wordpress plugin. This is how I'm doing it without luck:
<?php if (ICL_LANGUAGE_CODE == 'es_En') { ?>
<p>Spanish text</p>
<?php> ?>
知道问题出在哪里吗?我查看了一些教程,他们就是这样做的.
Any idea where is the problem? I have check some tutorials and they do this way.
推荐答案
es_En
不是有效的语言代码.你只需要使用 es
:
es_En
isn't a valid language code. You'll want to just use es
:
<?php if (ICL_LANGUAGE_CODE == 'es'): ?>
<p>Spanish text</p>
<?php endif; ?>
这篇关于获取WPML的语言代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文