Created
October 1, 2018 17:46
-
-
Save lamberger/2e508f7f1fbcce525cd605af45241b99 to your computer and use it in GitHub Desktop.
Targets all terms in news and article taxonomies
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
| function pjl_single_tax_term_template( $single_template ) { | |
| global $post; | |
| //has_term( $term, $taxonomy, $post ); | |
| if ( has_term( '', 'news' ) ) { | |
| $single_template = dirname( __FILE__ ) . '/news.php'; | |
| } | |
| if ( has_term( '', 'article' ) ) { | |
| $single_template = dirname( __FILE__ ) . '/article.php'; | |
| } | |
| return $single_template; | |
| } | |
| add_filter( 'single_template', 'pjl_single_tax_term_template' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment