Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function redirect_singles() {
- if(is_singular()){
- $category = get_the_category();
- $currentcat = $category[0]->slug; //verifico o slug da categoria
- if (file_exists(TEMPLATEPATH."/single-$currentcat".".php")) {
- include(TEMPLATEPATH."/single-$currentcat".".php");
- }
- }
- }
- add_action('template_redirect', 'redirect_singles');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement