更改特定语言的logo

我有这个多语言的网站。切换到”阿拉伯语”后, 是否可以将徽标更改为其他徽标?

我目前正在使用Polylang插件, 这是我一起拼凑的:

if (pll_default_language() == 'lang1') { ?>
    <img src="http://umar-project.mlab.napravi.online/wp-content/uploads/2018/06/logo-white-eng.png" alt="">
    <?php } else { ?>
     <img src="http://umar-project.mlab.napravi.online/wp-content/uploads/2018/06/logo-whiteara.png" alt="">
    <?php } ?>

我正在使用WordPress。谁能帮我?


#1


代替pll_default_language使用pll_current_language。

pll_default_language将始终返回相同的值, 即使你更改网站语言也是如此。


#2


我使用get_bloginfo(‘language’)来检查polylang为

<?php
$currentlang = get_bloginfo('language');
if($currentlang=="en-GB") { ?>

<?php } elseif($currentlang=="pl-PL") { ?>

<?php } ?>

来源:

https://www.srcmini02.com/64876.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37382.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?