PHP code example of underpin / post-template-loader
1. Go to this page and download the library: Download underpin/post-template-loader 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/ */
underpin / post-template-loader example snippets
\Underpin\underpin()->post_templates()->add( 'template', [
'name' => 'Template Name', // Shows in dropdown
'template' => 'template-name' // Shows when post template is fetched, and in REST
] );
underpin()->post_templates()->add('key','Namespace\To\Class');