Created
February 25, 2012 07:08
-
-
Save thanosp/1907166 to your computer and use it in GitHub Desktop.
Install Skellie with cherry picking on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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