Created
August 28, 2018 17:49
-
-
Save rogden/d3d17c408e4ceb7e56e9e3a9d977f79f to your computer and use it in GitHub Desktop.
Example of rendering template from Fractal in WordPress Theme
This file contains 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 | |
// https://fractal.build/ | |
the_post(); | |
get_header(); | |
// render is a global function exposed to render templates from Fractal. @article is the template handle in Fractal. The | |
// Handlebars rendering engine has been setup to load templates from a pattern-library directory that contains the Fractal install. | |
render( '@article', [ | |
'title' => get_the_title(), | |
'content' => get_the_content(), | |
] ); | |
get_footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment