<?php
$post = $wp_query->post;
if(in_category('information')){
include(TEMPLATEPATH . '/single-information.php');
}
elseif(in_category('event')){
include(TEMPLATEPATH . '/single-event.php');
}
elseif(in_category('blog')){
include(TEMPLATEPATH . '/single-blog.php');
}
else{
include(TEMPLATEPATH . '/single-defalut.php');
}
?>
やってみたら、できた。


single.phpをカテゴリ毎に分岐したかったけど、できなくて…
WordPressの個別記事ページをカテゴリ毎に違うものにしたかったので、分岐を書きました!! 全部、sing…
コメント