UI wrapper of Bootstrap for WordPress.
composer require kunoichi/bootstrapress
And in your functions.php
, require vendor/autoload.php
.
// functions.php
require __DIR__ . '/vendor/autoload.php';
Now you are ready!
It simply wraps Bootstrap UI to WordPress one.
Convert WordPress menu's HTML to suit with Bootstrap navbar.
// Pass $theme_location of your menu.
// It will be output as navbar.
new \Kunoichi\BootstraPress\NavbarMenu( 'header-menu' );
Output Bootstrap style pagination for archive page. Wrapping it in your function because of future updates.
/**
* Output pagination for archive page.
*/
function your_theme_pagination() {
\Kunoichi\BootstraPress\PageNavi::pagination();
}
Output links for paginated posts in Bootstrap style. Uses wp_link_pages
internally.
Wrapping it in your function because of future updates.
/**
* Output pagination for archive page.
*/
function your_theme_link_pages() {
\Kunoichi\BootstraPress\PageNavi::pagination();
}
You can extract colors for Gutenberg color panel.
/**
* Register colors.
*/
add_action( 'after_setup_theme', function() {
if ( ! class_exists( 'Kunoichi\BootstraPress\Css\Extractor' ) ) {
return;
}
$extractor = new Kunoichi\BootstraPress\Css\Extractor( get_template_directory() . '/style.css' );
$pallets = $extractor->get_color_palette();
if ( ! $pallets ) {
return;
}
$colors = [];
foreach ( $pallets as $slug => $color ) {
$colors[] = [
'name' => ucfirst( $slug ), // For i18n, consider translation function.
'slug' => $slug,
'color' => $color,
];
}
add_theme_support( 'editor-color-palette', $colors );
} );
GPL 3.0 and later. Compatible with WordPress.