css - 在 wordpress 上开发主题时如何解决 css 问题?

标签 css wordpress themes

我正在使用 wordpress 的 undersocres.me 开发我的主题。当我开始 开发和使用

  wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css'); 

it showed error .

wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css');

bootstrap.css:8 Uncaught SyntaxError: Unexpected token :

最佳答案

你需要使用 wp_enqueue_style 而不是 wp_enqueue_script

wp_enqueue_style( 'bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.css');

关于css - 在 wordpress 上开发主题时如何解决 css 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56733264/

相关文章:

php - 获取 Woocommerce 3 中的订单费用项目详细信息

html - Big Cartel - Luna 2x2 产品主页

html - 删除 ionic 中 ionic 列表元素的焦点线

javascript - 在悬停时更改 ul 下内容的字体颜色

database - 为什么在手动建立与 wordpress 数据库的新连接后我无法访问我的 Rails 应用程序数据库?

flutter - 如何在 flutter 朔迷离的共享首选项中存储主题

html - bootstrap 4 内的 SVG 行,flex div 不可见

php - %0d%0a 被添加到 <a> 标记中的 href 属性的 URL 后面

android - 我如何从 styles.xml 设置 RelativeLayout 的样式 - Android

r - 复制和修改默认主题