A plugin to write Object-Oriented code in combination with the Twig templating enging while keeping the WordPress Way of working in mind.
Composer, that's it.
Uses the internal Template Hierarchy so you can replace index.php
with index.twig
or archive-company.php
with archive-company.twig
and still have all Posts or CPT's available in "The Loop".
It autoloads a default Object just like WP_Post
but with some more handy stuff.
When you register a Custom Post Type ll_company
your custom class ll_company
gets loaded in the objects
variable within archive-company.twig
.
Loading your own objects can be done in two ways:
- Per complete directory by adding it via the filter
clarkson_available_objects_paths
. - Per single
object
/class
file viaclarkson_available_objects
.
Our advice is you extend your new class with Clarkson_Object
.
- Clone repository or download zip.
- Run
composer install
in theCore
directory.
Should work out of the box with an empty theme or use the starter theme Clarkson Theme