0

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 :

2 Answers 2

1

you need to use wp_enqueue_style instead of wp_enqueue_script

wp_enqueue_style( 'bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.css');
Sign up to request clarification or add additional context in comments.

1 Comment

yes it worked very much . i did so careless. thank you for answer
0

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/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.