wordpress - 如何将 boostrap 4 包含到自定义 wordpress 主题中?
问题描述
我正在研究自定义 wordpress 主题,并尝试使用 boostrap 4 代码将自定义 html 内容包含到我的页面中:
<div class="container">
<div class="row">
<div class="col-sm">
One of three columns
</div>
<div class="col-sm">
One of three columns
</div>
<div class="col-sm">
One of three columns
</div>
</div>
</div>
根据官方文档,我已将本地所有 boostrap 依赖项添加到我的主题中:
function theme_scripts() {
wp_enqueue_style( 'boostrap', get_template_directory_uri() . '/css/boostrap.min.css' );
/* Boostrap 4 library */
wp_enqueue_script('jquery-theme',get_template_directory_uri() . '/js/jquery-3.2.1.slim.min.js', array(), '3.2.1', true);
wp_enqueue_script('popper', get_template_directory_uri() . '/js/popper.min.js', array(), '', true );
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery', 'popper'), '4.0.0', true );
}
当我进入我的网页时,我看到所有列都进入了不同的行:(
如何将 boostrap 包含到我的 wordpress 主题中?有什么特殊的操作吗?
感谢:D
解决方案
您是否检查了文件名,因为您加载了一个名为boostrap.min.css的文件
wp_enqueue_style( 'boostrap', get_template_directory_uri() . '/css/boostrap.min.css' );
推荐阅读
- sql - 如何对oracle sql中的数字字符串进行数学比较
- bash - 在 tgz 的所有文件中搜索一个文本
- android - Glide.with(context).load("file://"+bitmapList.get(position)) 显示错误?
- javascript - 使用 AJAX/jQuery 将内容加载到 div
- javascript - 如何将数组与 jQuery.val 一起使用
- sql - 与 max 连接的 SQL 表
- dependencies - 一个用例可以包含和前置相同的其他用例吗?
- mql4 - 更改 request.comment-value?
- json - 图表查询不再支持 accountEnabled 过滤器
- android - com.android.build.api.transform.TransformException:java.lang.RuntimeException:无法预先 dex