Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Setup a Bootstrap Theme Add Bootstrap CSS via the functions.php File

Mike Bronner
Mike Bronner
16,395 Points

Error When Adding Bootstrap CSS File

I'm getting the following error after adding the Bootstrap CSS file as explained in this video:

[Error] SyntaxError: Unexpected token '<' (bootstrap.min.css, line 1)

I have been unable to google a solution for this -- any thoughts?

Here's my functions.php:

<?php
function theme_styles()
{
    wp_enqueue_style('main_css', get_template_directory_uri() . '/style.css');
    wp_enqueue_style('bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css');
}
add_action('wp_enqueue_scripts', 'theme_styles');

1 Answer

Mike Bronner
Mike Bronner
16,395 Points

My mistake ... it was a typo further down. During the copy process to include the bootstrap JS files, I forgot to rename the css file to js. Thanks! :)