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

Motoki Higa
Motoki Higa
14,111 Points

Is it good idea to use Bootstrap with WP child theme. If so, which is the best way CDN or download whole thing?

Hi, I've been learning Bootstrap and WP here. Im thinking to create my webfolio by using both of them for practice.

Then now, Im stuck already. I don't know where to start.

In the Bootstrap course by Gil, I've learnt how to use CDN. (Not with WP). Then, in the Wordpress course by Zac, I've learnt how to create child theme (Not using Bootstrap), and also how to use Bootstrap to create custom theme from scratch.

For my website though, I don't think I need to create it from scratch, but at the same time, I want to be able to customise a theme. So I will probably create a child theme. I really want to practice both Bootstrap and WP together, doing so I can save some time too.

I've been researching a quite bit about using Bootstrap with WP child theme. But I can't really find anyone talking about it.

Is it bad practice to use Bootstrap for WP child theme? Or doesn't it make any sense? I kinda feel they don't go with each other, because child theme already has its style passed down from the parent, so if I link or install Bootstrap, it's gonna conflict, and break the whole thing.

If it's fine to use Bootstrap with WP, what is the best practice to use Bootstrap? CDN or install them?

Thanks for the advice in advance!

Sean Hayes
Sean Hayes
Courses Plus Student 8,106 Points

In the boxing match of CDN vs Download

  • CDN: Immediate access to latest versions but you may see slightly slower load times for pages
  • Download: Slightly faster load times but whenever there is a new version of Bootstrap, you need to manually download and install

As for Bootstrap vs WP Child, I haven't worked with WP much

3 Answers

Kevin Korte
Kevin Korte
28,149 Points

The benefit of a CDN is that if you use a popular CDN, there is a chance that the user's browser already has bootstrap's files in it's cache from another site that also used a CDN. The downside is that even then good CDN's are not always 100% up time, so you should have your site fallback to a local copy if the CDN fails.

Motoki Higa
Motoki Higa
14,111 Points

Thanks Kevin, this is good to know, and makes sense!

Motoki Higa
Motoki Higa
14,111 Points

Thanks Sean, Right, both has pros and cons, CDN sounds better and it's tempting, coz it's much easier to set up.

I wonder who works with Bootstrap and WP child theme together out there? I might as well try this way, but If there is anyone who prefer to do this way, I would like to know the good side and down side of it.

Idan Melamed
Idan Melamed
16,285 Points

Hi Motoki,

I didn't watch it yet, but maybe this course can help: https://teamtreehouse.com/library/from-bootstrap-to-wordpress

Motoki Higa
Motoki Higa
14,111 Points

Hi Idan, thanks for the suggestion. Yes, I've finished that course, but it was the combination of custom theme from scratch + package of bootstrap. I was wondering about the combination of child theme + CDN. For some reason, I thought a child theme and CDN is bad combination, since I couldn't find people talking about it, and even some article said WP and Bootstrap doesn't go with each other.

Kevin Korte
Kevin Korte
28,149 Points

There is no reason bootstrap and WP wouldn't go together, the two are completely independent from each other. Just use the same enqueue_style function you normally would, but instead of passing it a local URL to the file on your server, pass it the full CDN url, and that's what it will grab.

This is assuming the parent theme doesn't already use bootstrap. You may be seriously bloating your child theme if you have to bring in boostrap to modify it. You may want to consider just building your own theme from scratch.

Motoki Higa
Motoki Higa
14,111 Points

Thanks Kevin,

Good to know about these information. And I think you are right, it will be bloated unnecessarily, plus my website won't be complicated at all. I reckon I should just create it from scratch, that's the best way to learn too.

Thanks for your help.