【发布时间】:2021-02-23 13:12:32
【问题描述】:
我正在开发自定义 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>
我已根据official documentation 将本地所有 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
【问题讨论】:
标签: wordpress bootstrap-4