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

Andrelo Coyac
Andrelo Coyac
4,877 Points

What is the point of 'From Bootstrap to Wordpress ' course

Hello Everyone. So I got a little bit confused with the course "From Bootstrap to Wordpress", at first I thought the course was going to cover all the basics of how to use BS, but it was more about how to install BS and make it work with the WP components.. But my question is: What is the purpose of using BS by making those functions in the functions.php file? is it just simpler to have the links to the stylesheets on the header.php file like the usual way? the instructor spend a lot of time setting up some functions that did worked but I just can find what is the benefit of doing that... hope somebody explains to me the differences

Thank You Andrelo

1 Answer

Kevin Korte
Kevin Korte
28,148 Points

I assume you're talking about importing the boostrap css and js files in through a enqueue function in the function.php file? If that's is the case, you should always bring in css and js files through these functions, its the recommended way to do so.

And here is the big reason why: Links a script file to the generated page at the right time according to the script dependencies, if the script has not been already included and if all the dependencies have been registered.

Because WP has it's own ecosystem, it will make sure that the right files are added at the right time when you use the enqueue functions - so what was shown here is best practices.