根据我的要求, 我需要一个仅支持桌面视图的主题。请尽快回答。在我现有的主题中, 我从标头中删除了元视口代码, 但移动响应仍在工作。现在做什么。
#1
啊哈, 你将网站卖给了一位客户, 并告诉他要让它具有响应能力要贵得多, 所以他没有选择吗?现在, 你要禁用主题^^默认设置的响应。
在functions.php中删除它
function et_add_viewport_meta(){
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />';
}
add_action( 'wp_head', 'et_add_viewport_meta' );
你还需要删除主题上的所有CSS代码, 例如:
/* Responsive Styles Tablet And Below */
remove code here ...
/* Responsive Styles 782px */
remove code here ...
/* Responsive Styles Smartphone Only */
remove code here ...
/* Responsive Styles Smartphone Portrait */
remove code here ...
/* Responsive Styles Tablet Portrait And Below */
remove code here ...
只需转到此处, 然后按照教程进行即可:http://www.agentwp.com/disable-sensitive-design-in-divi-wordpress-theme
#2
// Remove Divi Default Viewport <meta>
function remove_divi_actions() {
remove_action( ‘wp_head’, ‘et_add_viewport_meta’ );
}
// Call ‘remove_divi_actions’ during WP initialization
add_action(‘init’, ’remove_divi_actions’);
与其编辑Divi父主题功能文件, 不如将其添加为片段或添加到子主题功能文件中。
#3
how to usage in code for working full destop work
If you must do it, then the process to make Divi unresponsive is following.
• Open functions.php file and delete this code, function et_add_viewport_meta(){
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />';
}
add_action( 'wp_head', 'et_add_viewport_meta' );
评论前必须登录!
注册