Reputation: 37
I am developing my theme using undersocres.me for wordpress. When i started to develop and used
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css');
it showed error .
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css');
bootstrap.css:8 Uncaught SyntaxError: Unexpected token :
Upvotes: 0
Views: 44
Reputation: 9739
Just change get template directory to get_stylesheet_directory_uri()
and the enqueue to wp_enqueue_style
Example:
wp_enqueue_style( 'bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.css');
https://developer.wordpress.org/reference/functions/wp_enqueue_style/
Upvotes: 0
Reputation: 9341
you need to use wp_enqueue_style
instead of wp_enqueue_script
wp_enqueue_style( 'bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.css');
Upvotes: 1