Skip to content

Instantly share code, notes, and snippets.

@thanosp
Created February 25, 2012 07:08
Show Gist options
  • Save thanosp/1907166 to your computer and use it in GitHub Desktop.
Save thanosp/1907166 to your computer and use it in GitHub Desktop.
Install Skellie with cherry picking on
<?php
require_once __DIR__ .'/library/Skellie/Frame.php';
use Skellie\Frame;
/**
* Takes over the rendering process and uses layouts instead
* @param string $templateFile
* @return null
*/
add_filter('template_include', function ($templateFile) {
$frame = new Frame($templateFile);
// cherry picking forces templates to choose a layout or wordpress will go on
$output = $frame->requireCherryPicking(true)
->render();
// if the frame render returned null go on with regular wordpress
if (null === $output) {
return $templateFile;
}
echo $output;
// required in order to prevent wordpress from rendering
return null;
}, 10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment