如何在WordPress中向移动用户显示不同的网站徽标?

我正在研究电子商务主题, 并且如果设备是移动设备, 我一直试图使网站显示不同的徽标, 这可能吗?

注意:我正在使用一个称为店面的WordPress主题。


#1


尝试这个

<style>  
  .sitelogo .mobilelogo {
    display: none;
  }

  @media (max-width: 600px) {
    .sitelogo .mobilelogo {
      display: block;
    }
    .sitelogo .desktoplogo {
      display: none;
    }
  }
</style>

<div class="sitelogo">
  <img src="/images/logo_desktop.png" class="desktoplogo" />
  <img src="/images/logo_mobile.png" class="mobilelogo" />
</div>

并尝试以下代码, 请查看此链接以获取更好的参考

if ( wp_is_mobile() ) {
    /* Include/display resources targeted to phones/tablets here */
} else {
    /* Include/display resources targeted to laptops/desktops here */
}

来源:

https://www.srcmini02.com/63103.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_41987.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?