Home - nikonorovsv/wpf GitHub Wiki

WPF is a WordPress Framework to make your creating of theme easy.

Quick Start

  1. Install Composer.
  2. Move to the theme folder: cd {WP_path}/wp-config/themes/{theme_name}
  3. Create composer.json file and add WPF requires like this:
{
  "autoload": {
    "psr-4": {
      "wpf\\": "vendor/nikonorovsv/wpf/",
      "app\\": "app/"
    }
  },
  "require": {
    "nikonorovsv/wpf": "dev"
  },
  "repositories":[
    {
      "type":"package",
      "package":{
        "name":"nikonorovsv/wpf",
        "version":"dev",
        "source":{
          "type":"git",
          "url":"http://github.com/nikonorovsv/wpf",
          "reference":"master"
        }
      }
    }
  ]
}
  1. Run composer install
  2. Create your app.config.json into theme base directory.
  3. Open your functions.php and create your App:
get_template_part( 'vendor/autoload' );
get_template_part( 'vendor/nikonorovsv/wpf/functions' );

$conf = [
    'vendor/nikonorovsv/wpf/wpf.config.json',
    'app.config.json'
];

$app = app();
$app->loadAttributes( $app::readJsonConf( $conf ) );
$app->applyObservers();