dpkrbe395930
2018-07-03 15:28 阅读 53
已采纳

更改特定语言的徽标

I have this multilingual website. Is there a way I can change the logo to a different logo after I switch to "Arabian?"

I am using Polylang plugin at the moment and this is what I have scrummed together:

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 } ?>

I'm using WordPress. Can anyone help me?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    dongshan1396 dongshan1396 2018-07-03 16:00

    Instead of pll_default_language use pll_current_language.

    pll_default_language will return always the same value, even when you change your website language.

    点赞 评论 复制链接分享
  • dpyln64620 dpyln64620 2018-07-03 17:03

    i use get_bloginfo('language') for check polylang as

    <?php
    $currentlang = get_bloginfo('language');
    if($currentlang=="en-GB") { ?>
    
    <?php } elseif($currentlang=="pl-PL") { ?>
    
    <?php } ?>
    
    点赞 评论 复制链接分享

相关推荐