<?php

/**
 * Template Name: Custom template
 *
 * @package Stencil
 * @subpackage Theme
 */
// Make sure WordPress is loaded.
if (!function_exists('add_filter')) {
    header('Status: 403 Forbidden');
    header('HTTP/1.1 403 Forbidden', true, 403);
    exit;
}
$stencil = get_stencil();
$stencil->set('origin', __FILE__);
예제 #2
0
/**
 * Get a new handler to create snippet HTML
 *
 * Usable in AJAX requests.
 *
 * @param Stencil_Implementation|null     $implementation Optional. Set Implementation on new Handler.
 * @param Stencil_Recorder_Interface|null $recorder Optional. Supply a custom Recorder.
 *
 * @return Stencil_Handler
 */
function get_stencil_handler(Stencil_Implementation $implementation = null, Stencil_Recorder_Interface $recorder = null)
{
    return get_stencil()->get_handler($implementation, $recorder);
}
<?php

/**
 * Default template variables
 *
 * @package Stencil
 * @subpackage theme
 */
$controller = get_stencil();
$controller->set('planet', 'world');
$controller->set('blog_title', get_bloginfo('name'));
$controller->set('blog_description', get_bloginfo('description'));
$controller->set('blog_url', get_home_url());
$controller->set('page_title', wp_title('-', false, 'right'));
$controller->set('template_uri', get_template_directory_uri());
<?php

/**
 * DO NOT EDIT THIS FILE!
 *
 * @package Stencil
 * @subpackage Theme
 */
// Make sure WordPress is loaded.
if (!function_exists('add_filter')) {
    header('Status: 403 Forbidden');
    header('HTTP/1.1 403 Forbidden', true, 403);
    exit;
}
if (!function_exists('get_stencil')) {
    $theme_name = wp_get_theme()->get('Name');
    header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
    trigger_error(sprintf('The active theme (%s) requires the "Stencil" plugin to be activated.', $theme_name), E_USER_ERROR);
} else {
    get_stencil()->run();
}
die;