从手机上移除黑条
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了从手机上移除黑条相关的知识,希望对你有一定的参考价值。
If you user logs in and they're on a mobile phone, they might get that annoying black bar on top. This script removes that if they can edit posts or on mobile.
/** ******** ******** ******** ******** ******** ******** ******** ******** * Checks if a particular user has a role. * Returns true if a match was found. * * http://codex.wordpress.org/Roles_and_Capabilities#Subscriber * http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/ * * @param string $role Role name. * @param int $user_id (Optional) The ID of a user. Defaults to the current user. * @return bool */ if (!current_user_can('edit_posts') || wp_is_mobile() ) { show_admin_bar(false); }
以上是关于从手机上移除黑条的主要内容,如果未能解决你的问题,请参考以下文章