Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,135 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.