Twitter has just came out with a new web framework called Bootstrap. What’s the right way to use it within a theme?
Update: The stylesheet inclusion is simple indeed. I want to know which caveats or compatibility issues I should expect.
Twitter has just came out with a new web framework called Bootstrap. What’s the right way to use it within a theme?
Update: The stylesheet inclusion is simple indeed. I want to know which caveats or compatibility issues I should expect.
You must be logged in to post a comment.
A few things to consider:
wp_enqueue_style()
, and hooked into eitherwp_enqueue_scripts
orwp_print_styles
wp_enqueue_script()
, and hooked into `wp_enqueue_scripts()wp_nav_menu()
/wp_list_pages()
/etc.), Pagination (paginate_links()
/paginate_comments_links()
/wp_link_pages()
), etc. integrate with core WordPress functionalityjust a theme folder with the bootstrap folder and then i make a style.css with
my $0.02
Depending on the theme you’re using, you may not be able to enqueue the CSS stylesheet as you need to.
You need to include it as the absolute first CSS in your site, or you can have unexpected design quirks. We use Thesis Framework a lot and it even prevented us from doing this.
So we wrote a plugin to solve this problem. No matter what theme you use you can include the latest twitter bootstrap CSS as the first CSS link in your site. It is the first entry after the opening document HEAD element.
The plugin also has twitter bootstrap Javascript support and now has a LESS compiler so you can completely customize your bootstrap styling. There are also shortcodes includes so you can use some of the Twitter Bootstrap elements quickly too.
This will work with ANY theme you use.
Grab it from the WordPress.org repository here.
Let me know what you think…
Cheers,
Paul.
WordPress theme has near-absolute control over output. There are possible minor issues (like WP functions generating some classes in output that framework uses), but simply put there won’t be anything that you can’t work around with moderate effort (theme development itself being more than moderate effort).