taxonomy용 single.php을 어떻게 생성하나요?
구글링해서
add_filter( ‘single_template’, ‘single_tax_term_template’ );
function single_tax_term_template( $single_template ) {
global $post;
if ( has_term( ”, ‘article’ ) ) {
$single_template = dirname( __FILE__ ) . ‘/article.php’;
}
if ( has_term( ”, ‘news’ ) ) {
$single_template = dirname( __FILE__ ) . ‘/news.php’;
}
return $single_template;
}
위 코드를 function.php에 추가를 했는데 후에 택소노미용 페이지용 single.php를 만들어서 적용하려는데 감이 잘 안와서 질문 남겨드립니다.