不同设备使用不同筛选器 CSS(WOOF_HELPER::is_mobile_device)
有时用户需要根据客户端设备(PC或移动设备)来操作网站CSS。您可以通过以下代码示例实现,该代码应放置在您当前WordPress主题的footer.php文件中:
<?php
if (WOOF_HELPER::is_mobile_device()): ?>
<style type="text/css">
.woof_show_auto_form {
display: inline-block !important;
}
</style>
<?php else: ?>
<style type="text/css">
.woof_show_auto_form {
display: none !important;
}
</style>
<?php endif; ?>
当前示例展示了如何在PC上隐藏woof自动表单按钮,并在移动设备上显示它…