Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Sage | 12,107 | 6 | 3 | 4 days ago | 40 | July 19, 2022 | 13 | mit | PHP | |
WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow | ||||||||||
Timber | 5,209 | 131 | 77 | 7 days ago | 115 | June 22, 2022 | 209 | mit | PHP | |
Create WordPress themes with beautiful OOP code and the Twig Template Engine | ||||||||||
Typography.js | 3,757 | 2,206 | 186 | 4 months ago | 79 | May 10, 2021 | 95 | mit | JavaScript | |
A powerful toolkit for building websites with beautiful design | ||||||||||
Argon Theme | 3,160 | 2 months ago | 120 | gpl-3.0 | PHP | |||||
📖 Argon - 一个轻盈、简洁的 WordPress 主题 | ||||||||||
Understrap | 2,957 | 81 | 1 | 2 days ago | 37 | November 08, 2021 | 75 | gpl-3.0 | CSS | |
Underscores + Bootstrap = Understrap, the renowned open-source WordPress starter theme. | ||||||||||
Sakura | 2,947 | 2 months ago | 20 | gpl-2.0 | PHP | |||||
A Wonderful WordPress Theme: 樱花庄的白猫博客主题 | ||||||||||
Frontity | 2,823 | 6 | 67 | 2 months ago | 60 | July 19, 2022 | 66 | apache-2.0 | TypeScript | |
» Frontity - The React Framework for WordPress | ||||||||||
Foundationpress | 2,780 | 4 years ago | 35 | April 12, 2019 | 55 | mit | PHP | |||
FoundationPress is a WordPress starter theme based on Foundation 6 by Zurb | ||||||||||
Kratos | 2,708 | a day ago | 7 | gpl-3.0 | PHP | |||||
📖 WordPress theme that focus on reading experience | ||||||||||
Plugin Update Checker | 1,927 | 63 | 30 | 21 days ago | 31 | July 24, 2022 | 79 | mit | PHP | |
A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes. |
Building blocks to develop a config-based Genesis Framework child theme for WordPress.
When building a theme, wouldn't it be nice to separate out the implementation-specific config, from the reusable logic? This is the premise upon which the Using a Config to Write Reusable Code series articles are written, and which this package enables.
Specifically, this packages builds upon the Theme Toolkit package, and adds bricks that are specific to Genesis child theme development. It provides an easy way to:
add_theme_support( 'custom-logo' )
functionality.The ThemeToolkit and GenesisThemeToolkit packages are for theme customisations - what theme support to add, what CSS/JS dependencies to add in, how many footer widgets to allow, what layouts to add/remove, what image sizes there should be - all stuff that would historically gone into functions.php
or some other include file.
When that is all set in functions.php
though, the important values are often lost in a mixture of logic (what to do with those values), and boilerplate (opening and closing functions, hooking in to filters etc.), and that can make it harder for end theme authors to seek out and configure those important values to their liking.
By following a sort of separation of concerns principle, we use a config file to keep the important values all in one place (easy to tell people where and how to edit), and then keep the rest of the logic and boilerplate away from those who are less confident with PHP. They get a single place to make amendments, and you don't have to maintain the default logic.
Any theme can use the ThemeToolkit, and Genesis child theme can use this GenesisThemeToolkit.
For premium themes, you would set the toolkit(s) as a composer dependency, to pull it in locally for development, and then just be sure to include vendor/gamajo/...
within your distributable theme zip.
Requires PHP 7.1.
In a terminal, browse to the directory with your theme in and then:
composer require gamajo/genesis-theme-toolkit
You can then autoload (PSR-4) or require the files as needed.
See the example-config.php. This would typically live in your theme, at config/defaults.php
.
Your theme would then contain a function, in the functions.php
, to pull in this config, and load up the individual components, which are referred to as bricks:
// 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);
}
}
The 'Gamajo\ExampleTheme'
string matches the two keys in the return
at the bottom of the config file. Change this in the config and the function to be your company name and theme name.
You don't have to use all of the bricks in this package; pick and choose.
You can add your own bricks to your theme (in your src/
or similar directory), and then make use of them in the function above.
If you're not using the Genesis Framework, see the Theme Toolkit which has just the bricks applicable for building themes in general.
Please see CHANGELOG.md.
Built by Gary Jones
Copyright 2017 Gamajo