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

Bootstrap CDN

I am watching the video add bootstrap css, in the video Zac adds this to the theme folder. But you can also use a CDN I know the advantage to the CDN is that it may already be in the users cache from visiting another site. But is there any disadvantage to doing it this way?

3 Answers

Steven Byington
Steven Byington
13,584 Points

The main things that can affect your site if using a CDN are not being able to customize the file (although I don't don't know why you would) and the chance of the CDN going down (which most likely won't happen depending on who is hosting). The advantages definitely outweigh the disadvantages though.

There are some disadvantage of loading from CDN network.

  1. You cannot verify the best location of the file.
  2. You cannot easily maintain the files.
  3. Its impractical. Unless you are hosted files that you want anybody can grab it.
  4. If ever the Network fails, you cannot fix it.

How do you include a CDN in the wordpress project?

from the bootstrap site you can get the link to their CDN..then just post that location into the wp_enqueue_style() function as you would the location for the local bootstrap.css file.