Created
October 15, 2011 14:02
-
-
Save billerickson/1289603 to your computer and use it in GitHub Desktop.
Interstrategy Events Manager - Same template for taxonomy
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 | |
/** | |
* Template Redirect | |
* Use archive-event.php for all events and 'event-category' taxonomy archives. | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/use-same-template-for-taxonomy-and-cpt-archive/ | |
* | |
* @param string, default template path | |
* @return string, modified template path | |
* | |
*/ | |
function be_template_redirect( $template ) { | |
if ( is_tax( 'event-category' ) ) | |
$template = get_query_template( 'archive-event' ); | |
return $template; | |
} | |
add_filter( 'template_include', 'be_template_redirect' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment