【发布时间】:2017-02-19 01:31:59
【问题描述】:
我在将 boostrap 添加到 wordpress 子主题时遇到问题。
这是我的文件夹在子主题中的外观: http://i.imgur.com/vuOvYJ3g.jpg
并且有来自 css 文件夹的内容 http://i.imgur.com/AsQAi3r.jpg
在function.php中我试过这个:
function theme_add_bootstrap() {
wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/css/bootstrap.min.css' );
wp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css' );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'theme_add_bootstrap' );
但不起作用,在 index.php 中我写了 class col-sm-3 并在 Chrome 的检查元素中没有从引导程序中读取类和样式。
你能帮帮我吗,非常感谢!
【问题讨论】:
标签: php css wordpress twitter-bootstrap