Neochic / Woodlets

Create WordPress Page Layouts using Twig Templates
MIT License
9 stars 2 forks source link

Woodlets

Build Status Join the chat at https://gitter.im/Woodlets/Lobby

Woodlets is beta. We think it's stable enough be used it in productive environments and we do so.
However you should copy the default templates directory from views/defaultTemplates into the woodlets directory of your theme. This helps to prevent incompatibilities with future Woodlets versions.

Feedback and feature requests are welcome!

Woodlets is a WordPress plugin that makes theme development more productive and fun.
The main features are:

Installation

Installation via TGM Plugin Activation is recommended. With TGMPA Plugin Activation you can define Woodlets as a required dependency for your theme.
But there is also a bundled version that can be installed manually.

Install via TGM Plugin Activation

  1. Install TGM Plugin Activation as they explain in their installation manual.
  2. Include and configure the TGM Plugin Activation library to load Woodlets:

    <?php
    require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php';
    
    add_action( 'tgmpa_register', function() {
        $plugins = array(
            array(
                'name'               => 'Woodlets',
                'slug'               => 'woodlets',
                'source'             => 'https://github.com/Neochic/Woodlets/releases/download/v0.6.13/woodlets-v0.6.13-bundled.zip',
                'required'           => true,
                'force_activation'   => true,
                'force_deactivation' => true
            )
        );
        tgmpa( $plugins );
    });

Check "Woodlets Seed"-Theme Tgm.php for a working example.

Install manually

  1. Go to releases page and download the latest bundled release.
  2. Extract the zip archive to your WordPress plugins directory (usually "wp-content/plugins/").
  3. Activate the plugin on the plugins page of your WordPress installation.

Getting started

For the creation of new Woodlets themes we recommend to use "Woodlets-CLI" instead of starting from scratch. It might also be a good idea to take a look at the "Woodlets Example"-Theme.

Create a theme manually

  1. Be sure the Woodlets plugin is installed and activated.
  2. Create a new theme (as the WordPress documentation says it should at least contain style.css and index.php)
  3. Put the following lines into your index.php:

    <?php
    do_action('neochic_woodlets_render_template');

    The action neochic_woodlets_render_template initializes the template rendering.

  4. Activate your new theme.
  5. Create your first page template with at least one column. Learn how to create your own page templates.
  6. Create your first Woodlets widget. Learn how to create custom widgets.
  7. Add your new widget to the allowed widgets configuration of your page template column.
  8. Create or edit a page and use your new page layout to test your widget in backend and frontend.

Further Reading: