I've got a small issue with my archive.php. I was trying to set up an If statement that displays a certain category and sub categories with a different layout & sidebar based on my theme options. I've placed a small bit of code in the start of my archive.php in order to set these options based on if the post is in category 'nytt' or is a sub cat of nytt (ID 49). It works like a charm, if the category listing in part of NYTT or a sub cat, but now, all other categories don't display, the page won't load further than the header. And for the life of me I can't figure out why. I'm staring at this code like it holds a secret which it won't give up..
<?php
get_header();
$subtitle=get_opt("_posts_subtitle");
$slider='none';
if ( in_category( 'nytt' ) || post_is_in_descendant_category( 49 ) ) {
$layout='left';
$sidebar ='teacher-training';
}
else {
$layout = get_opt('_blog_layout');
$sidebar = get_opt('_blog_sidebar');
}
include(TEMPLATEPATH . '/includes/page-header.php');
?>
<div id="content-container" class="content-gradient <?php echo $layoutclass; ?> ">
<div id="<?php echo $content_id; ?>"><?php
if(have_posts()){
while(have_posts()){
the_post();
global $more;
$more = 0;
include(TEMPLATEPATH . '/includes/post-template.php');
}
print_pagination();
}else{
echo ('No posts available');
}
?>
</div>
<?php
if($layout!='full'){
print_sidebar($sidebar);
}
?>
<div class="clear"></div>
</div>
<?php
get_footer();
?>
Also I understand that I could be using the category.php to accomplish this as well, but as my theme was using archive.php by default I decided to use this instead. I've declared the [post_is_in_descendant_category] (http://codex.wordpress.org/Function_Reference/in_category#Testing_if_a_post_is_in_a_descendant_category)! function in my child themes functions.php.
Any help would be uber appreciated. Thanks for your time and expertise!