Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Roberts nathan-roberts

View GitHub Profile
View plugin-templates.php
<?php
// Template Logic
function twt_trailer_archive_template($original_template)
{
// Set our post type
$post_type = 'trailer';
// Set the expected path for a override template within the site theme
$file = trailingslashit(get_template_directory()) . "archive-$post_type.php";