PHP code example of livy / plumbing-templates

1. Go to this page and download the library: Download livy/plumbing-templates library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

livy / plumbing-templates example snippets


Livy\Plumbing\Templates\register_template_directory('custom-templates');

// Define templates for the `event` post type:
Livy\Plumbing\Templates\register_template_directory('event-templates', 'event');

add_action('init', function () {
    Livy\Plumbing\Templates\register_template_directory('event-templates', 'event');
});

Livy\Plumbing\Templates\setup_template_location([
    'paths' => [ 'event-templates' ],
    'post_type' => 'event',
]);