WordPress class for easily manage templates following the DRY principle.
- PHP >= 5.4
- WordPress >= 3.5
You can install this plugin via command-line or using the WordPress admin panel.
Using Composer, add Post Type Class to your project's dependencies.
composer require starise/wp-wrapper-class
Then activate the plugin via wp-cli.
wp plugin activate wp-wrapper-class
- Download the latest zip of this repo.
- In your WordPress admin panel, navigate to Plugins->Add New
- Click Upload Plugin
- Upload the zip file that you downloaded.
Declare the use of the class in functions.php
, then start using the class:
use Starise\WordPress\Wrapper as Wrapper;
function template_path() {
return Wrapper::$main_template;
}
For more details please check out this page