Hi everybody,
My settings are below:
I am using WP 3.1 and Thematic 0.9.7.7. I also use custom loops built based on this
http://hardiannazief.com/12/create-custom-posts-layout-in-home-page-thematic-child-theme/
I made some minor adjustments and I believe they're irrelevant.
My problem is:
I want to make a full width display on Last post page page and Category page. So I decided to get rid of the sidebar, and two options (that I know of) to do this is using a full width template or a function to "kill" the sidebar and make the proper adjustment on CSS (wider body container).
First I tried using a template, copied full-width.php from thematic and pasted it on my theme child. The file name appeared on my dashboard, but nothing changes, the sidebar is still there. But when I used it for the other pages, it works.
Since the first option failed, I tried the second one. The code:
// kill sidebar
function remove_sidebar(){
if (is_category() && is_page('4')){
return TRUE; // please notice this part
}else{
return FALSE; // and this
}
}
add_filter('thematic_sidebar', 'remove_sidebar');
First I was using Boolean FALSE and TRUE respectively, but it didn't worked, I googled and found Chris's method (which is the same)
http://programming.thematic4you.com/2010/01/how-to-remove-the-sidebar-from-a-certain-page/
but somehow, this isn't work. I switch the Boolean like my above code, and it works.
What went wrong?
Anyway, strange as it was, I've resolved it and move on to the next step, making the proper adjustment in CSS. Since I want the CSS specific to a Page and Category, I made a custom CSS file and use conditional function. My code is:
//full-width CSS for homepage and category
function fullwidth_css() {
if (is_page('Articles') && is_category()) {?>
<link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/full-width.css"/>
<?php }
}
add_action('wp_head', 'fullwidth_css');
Again, this is not working.
I have used two of the methods I mentioned here before, using template and conditional CSS style although of course there are minor differences, such as file name and conditions. It worked before but now, it is not.
Please tell me what is wrong or are there any changes that I am not aware of.
Thanks in advance!