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' );