Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michaelschofield/810d5b7a9bb93ce08417 to your computer and use it in GitHub Desktop.
Save michaelschofield/810d5b7a9bb93ce08417 to your computer and use it in GitHub Desktop.
<?php
// The function to create a taxonomy archive within a
// plugin is nearly identical to creating the post type
// archive, except instead of using is_post_type_archive()
// we use is_tax().
function advwp_create_series_template( $archive ) {
global $post;
if ( is_tax( 'series' ) ) {
return plugin_dir_path( __FILE__ ) . 'public/templates/taxonomy-series.php';
}
return $archive;
}
add_filter( 'archive_template', 'advwp_create_series_template' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment