PHP code example of kunoichi / bootstrapress

1. Go to this page and download the library: Download kunoichi/bootstrapress library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kunoichi / bootstrapress example snippets


// functions.php

// Pass $theme_location of your menu.
// It will be output as navbar.
new \Kunoichi\BootstraPress\NavbarMenu( 'header-menu' );

/**
 * Output pagination for archive page.
 */
function your_theme_pagination() {
    \Kunoichi\BootstraPress\PageNavi::pagination();
}

/**
 * Output pagination for archive page.
 */
function your_theme_link_pages() {
    \Kunoichi\BootstraPress\PageNavi::pagination();
}

/**
 * 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 );
} );