admin管理员组文章数量:1431912
I keep getting an error when I look into my page resource about my bootstrap.min.css file, which gives me a "Failed to load resource: the server responded with a status of 404 (Not Found)" => /wp-content/themes/test-theme/bootstrap/css/bootstrap.min.css.map
However, bootstrap does show in the browser so it should be fine, right? I am quite new to this and I don't understand why I get this error, yet my theme shows the bootstrap just fine.
I have this code:
function theme_add_bootstrap() {
wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css' );
wp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css' );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . 'bootstrap/js/bootstrap.min.js', array(), '3.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'theme_add_bootstrap' );
within my test-theme folder I have a folder named "bootstrap" in which I have my bootstraps CSS and JS files.
I keep getting an error when I look into my page resource about my bootstrap.min.css file, which gives me a "Failed to load resource: the server responded with a status of 404 (Not Found)" => http://theasianbean.local/wp-content/themes/test-theme/bootstrap/css/bootstrap.min.css.map
However, bootstrap does show in the browser so it should be fine, right? I am quite new to this and I don't understand why I get this error, yet my theme shows the bootstrap just fine.
I have this code:
function theme_add_bootstrap() {
wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css' );
wp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css' );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . 'bootstrap/js/bootstrap.min.js', array(), '3.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'theme_add_bootstrap' );
within my test-theme folder I have a folder named "bootstrap" in which I have my bootstraps CSS and JS files.
Share Improve this question edited Apr 14, 2019 at 3:53 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Apr 13, 2019 at 11:28 theasianbeantheasianbean 93 bronze badges1 Answer
Reset to default 0Put this code in functions.php
file and check it.
function theme_add_bootstrap() {
wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css' );
wp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css' );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '3.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'theme_add_bootstrap' );
本文标签: Bootstrap isn39t called into my Wordpress theme
版权声明:本文标题:Bootstrap isn't called into my Wordpress theme 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745591633a2665234.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论