PHP code example of gamajo / genesis-theme-toolkit
1. Go to this page and download the library: Download gamajo/genesis-theme-toolkit 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/ */
gamajo / genesis-theme-toolkit example snippets
// functions.php
namespace Gamajo\ExampleTheme;
use BrightNucleus\Config\ConfigFactory;
use Gamajo\GenesisThemeToolkit\BreadcrumbArgs;
use Gamajo\GenesisThemeToolkit\CustomLogo;
use Gamajo\GenesisThemeToolkit\FooterCreds;
use Gamajo\GenesisThemeToolkit\Layouts;
use Gamajo\GenesisThemeToolkit\Templates;
use Gamajo\GenesisThemeToolkit\ThemeSettings;
use Gamajo\GenesisThemeToolkit\WidgetAreas;
use Gamajo\ThemeToolkit\GoogleFonts;
use Gamajo\ThemeToolkit\ImageSizes;
use Gamajo\ThemeToolkit\ThemeSupport;
use Gamajo\ThemeToolkit\ThemeToolkit;
use Gamajo\ThemeToolkit\Widgets;
add_action( 'after_setup_theme', __NAMESPACE__ . '\setup' );
/**
* Theme setup.
*
* Compose the theme toolkit bricks.
*/
function setup() {
$config_file = __DIR__ . '/config/defaults.php';
$config = ConfigFactory::createSubConfig( $config_file, 'Gamajo\ExampleTheme' );
// These bricks are run in admin and front-end.
$bricks = [
ImageSizes::class,
Templates::class,
ThemeSupport::class,
Widgets::class,
Layouts::class,
ThemeSettings::class,
WidgetAreas::class,
CustomLogo::class,
];
// Apply logic in bricks, with configuration defined in config/defaults.php.
ThemeToolkit::applyBricks($config, ...$bricks);
if ( ! is_admin() ) {
// Only front-end bricks.
$bricks = [
FooterCreds::class,
BreadcrumbArgs::class,
GoogleFonts::class,
];
ThemeToolkit::applyBricks($config, ...$bricks);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.