function szub_cat_template_inherit() { if(is_category()) { global $wp_query; $category = $wp_query->get_queried_object(); if( $category->category_parent && file_exists(TEMPLATEPATH . ‘/category-‘ . $category->category_parent . ‘.php’) ) $template = TEMPLATEPATH . ‘/category-‘ . $category->category_parent . ‘.php’; elseif( file_exists(TEMPLATEPATH . "/category-" . get_query_var(’cat’) . ‘.php’) ) $template = TEMPLATEPATH . "/category-" . get_query_var(’cat’) . ‘.php’; elseif( file_exists(TEMPLATEPATH . "/category.php") )… Continue reading Sub-categories inherit the parent category template
Tag: categories
Exclude category from feed
Add to functions.php function myFeedExcluder($query) { if ($query->is_feed) { $query->set(’cat’,’-6’); } return $query; } add_filter(’pre_get_posts’,’myFeedExcluder’);
Exclude categories from index loop
<?php $posts=query_posts($query_string . ‘&cat=-6’); if (have_posts()) : while (have_posts()) : the_post(); ?>