Using Bootstrap in themes

A few things to consider:

  1. Enqueue stylesheets properly, using wp_enqueue_style(), and hooked into either wp_enqueue_scripts or wp_print_styles
  2. Enqueue scripts properly, using wp_enqueue_script(), and hooked into `wp_enqueue_scripts()
  3. Ensure that enqueued stylesheets and scripts are only enqueued on the front end, and not in the admin back end. Bootstrap and similar frameworks should only be used on the front-end, and should never be used to override or circumvent core UI in the admin back-end.
  4. Use built-in WordPress scripts wherever possible, to avoid conflicts with Plugins, etc. that may be relying on the core-bundled script being used.
  5. Consider core image sizes (thumbnail, medium, large) with respect to the Bootstrap media grid
  6. Ensure that UI elements such as Menus (wp_nav_menu()/wp_list_pages()/etc.), Pagination (paginate_links()/paginate_comments_links()/wp_link_pages()), etc. integrate with core WordPress functionality

Leave a Comment