A WordPress Starter Theme Based on Bootstrap 5

Bootstrap Logo

As Bootstrap 5 is now stable, I have updated my starter theme to use it with some general improvements over the previous V4.

https://github.com/RelevanceDigital/wp-bs-starter-theme

It uses the file structure from the best practices underscores theme created by Automattic which contains all files required for a properly functioning theme.

Each layout file uses Bootstrap classes and core output for menus, comments and forms are also bootstrapped.

Slick slider and Font Awesome have been removed from the basic install but can also be added back very easily.

After installing dependencies with npm install, rather than having to search and replace strings, running gulp install will now prompt you for a name for the theme. The name for the theme will be used to run an automatic search and replace on various strings throughout the theme and rename the _s.pot file to your-theme.pot which saves a lot of time for new users.

The header.php file has been reworked to use a common example of a navbar that incorporates a custom logo added in the WordPress customizer area.

The custom code area of the customizer now uses cleaner output removing logic from the layout files.

The customizer copyright text field also uses cleaner output and will replace {year} with the current year.

All sidebars have been removed by default as the theme is now primarily intended for use with the block editor.

An example of using the simple navwalker has been added to the footer wrapped in a check to see if the menu exists and contains any items. Add a menu to the footer position to see it appear.

Previous custom functions are still there and some have been improved.

The THEME-NAME_lazy_image() function will now also accept the ID of an image rather than requiring an array of images sizes. This makes it easy to display a lazy loaded srcset img tag without needing to convert the image into an array of sizes first and is ideal to use with custom fields that return an image ID or any images from the customizer that only return an ID.

Give it a go and let me know your thoughts!