How do I use WordPress together with Twitter Bootstrap? I know how to set up a WordPress page and I’ve already worked with Bootstrap, but now I want to use these two together for the first time.
For my WordPress projects I normally just installed WordPress and started from scratch with creating a new theme. For my Bootstrap projects I always used Initializr to build a template.
Now using Google I found various “Bootstrap themes” and plugins , do I need one of those? I want to customize the bootstrap look with my own colors etc. using LESS, that’s why I am asking. I am just having trouble to understand how these two will work together and I haven’t found any good resource for it.
There will be a few ways to tackle this, but here’s what I’ve been doing…
@import url("bootstrap/css/bootstrap.css");
It’s quite time consuming, but once its done it can obviously be re-used to speed up future projects.
Incidentally, I’ve also been building a theme using this same principle but based on http://stuffandnonsense.co.uk/projects/320andup/ both great projects. I’d recommend seeing which best suits you.
You could always us the Twitter Bootstrap WordPress plugin. It’s completely free on WordPress.org here: http://wordpress.org/extend/plugins/wordpress-bootstrap-css/
There’s also lots of shortcodes included so you can include Bootstrap elements within your pages and post – there’s a demo page of it all here: http://worpit.com/wordpress-twitter-bootstrap-css-plugin-home/wordpress-shortcodes-demo/
Hope that helps you get started!
I answered the same question before here at stackoverflow. I feel like it’s kind of late sharing but for those who are looking for such tutorial just click the hyperlinked title given: Using Twitter Bootstrap in WordPress.
There is a quick way to do it, using composer in your theme:
composer.json
Note: I removed the other composer’s section and requirements and phing integration to reduce complexity.
Execute
And then in your theme, add /lib/composer/twitter/bootstrap/dist/css/bootstrap.css with this sentences
et voilà ! 🙂