Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //creates category-slug based template for single post
- add_filter('single_template', create_function(
- '$the_template',
- 'foreach( (array) get_the_category() as $cat ) {
- if ( file_exists(TEMPLATEPATH . "/single-{$cat->slug}.php") )
- return TEMPLATEPATH . "/single-{$cat->slug}.php"; }
- return $the_template;' )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement