我们知道wordpress主题比如twentytwenty都会有样式,如果不想使用它们的默认样式怎么处理呢?其实很简单,一起来看看吧。进入2020主题的function.php文件,里面有Register and Enqueue Styles和Register and Enqueue Scripts的函数定义,大概177行左右,将它们注释就可以了
/**
* Register and Enqueue Styles.
*/
//function twentytwenty_register_styles() {
//
// $theme_version = wp_get_theme()->get( 'Version' );
//
// wp_enqueue_style( 'twentytwenty-style', get_stylesheet_uri(), array(), $theme_version );
// wp_style_add_data( 'twentytwenty-style', 'rtl', 'replace' );
//
// // Add output of Customizer settings as inline style.
// wp_add_inline_style( 'twentytwenty-style', twentytwenty_get_customizer_css( 'front-end' ) );
//
// // Add print CSS.
// wp_enqueue_style( 'twentytwenty-print-style', get_template_directory_uri() . '/print.css', null, $theme_version, 'print' );
//
//}
//add_action( 'wp_enqueue_scripts', 'twentytwenty_register_styles' );
/**
* Register and Enqueue Scripts.
*/
//function twentytwenty_register_scripts() {
//
// $theme_version = wp_get_theme()->get( 'Version' );
//
// if ( ( ! is_admin() ) && is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
// wp_enqueue_script( 'comment-reply' );
// }
//
// wp_enqueue_script( 'twentytwenty-js', get_template_directory_uri() . '/assets/js/index.js', array(), $theme_version, false );
// wp_script_add_data( 'twentytwenty-js', 'async', true );
//
//}
//
//add_action( 'wp_enqueue_scripts', 'twentytwenty_register_scripts' );
本文《禁用wordpress模板默认样式》由网友投稿或:「admin」整理自网络。
转载请声明来自:云猴子 - https://www.yunhouzi.com/818.html
1,本站所有资源均来源于用户上传或整理与网络,如有侵权请【内容投诉】删除,我们将及时处理!
2,本站资源仅供大家学习和交流,请不要用于商业用途,下载后请于24小时后删除!
3,如果你也有好的资源,可以投稿到本站,有金币奖励和额外的收入!
4,从您进入本站开始,已表示您已同意接受本站【版权声明】中的一切条款!
6,申明:本站资源出售只是赞助,仅用于本站服务器和日常运营所需!不提供任何技术支持。
7,如压缩包提示有密码,www.yunhouzi.com
云猴子 » 禁用wordpress模板默认样式
