禁用wordpress模板默认样式

  我们知道wordpress主题比如twentytwenty都会有样式,如果不想使用它们的默认样式怎么处理呢?其实很简单,随ytkah一起来看看吧。进入2020主题的function.php文件,里面有Register and Enqueue Styles和Register and Enqueue Scripts的函数定义,大概177行左右,将它们注释就可以了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
 * 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' );

  

posted @   ytkah  阅读(509)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
历史上的今天:
2014-11-21 公众平台自动回复支持插入微信卡券 多图文消息可嵌入卡券
网址导航 gg N / G Sitemap

部分内容来源于网络,如有版权问题请联系删除

  
点击右上角即可分享
微信分享提示