i'm trying to conditionally kill the sidebar based on meta data. seems to work brilliantly everywhere except with the blog template. if you take a look at the blog template it has the same call:
// calling the standard sidebar
thematic_sidebar();
as every other template so i can't figure out why my filter would not work on this page.
//will turn off sidebar if layout is set to fullwidth
function kia_kill_sidebar(){
global $layout_metabox;
$layout_metabox->the_meta();
$layout_meta = $layout_metabox->get_the_value('layout');
if ("full" == $layout_meta) {
return FALSE;
} else {
return TRUE;
}
}
add_filter('thematic_sidebar','kia_kill_sidebar');
i realize that this function is dependent on WPAlchemy... but that side is working properly as the above works on other templates... AND the following test function shows the correct values and passes properly through the same conditional.
function bacon(){
global $layout_metabox;
$layout_metabox->the_meta();
$layout_metabox->the_value('layout');
echo "<p></p>";
$layout_meta = $layout_metabox->get_the_value('layout');
if ("full" == $layout_meta) {
echo "yay";
} else {
echo "wtf";
}
}
add_action('thematic_belowheader','bacon');
however, it DOES work if i remove the conditionals and just return false- so i suspect it has to do with not yet having a value or the meta somehow getting messed up w/ the index loop? i've tried copying the blog template into my directory and adding wp_reset_query() b/c i have managed to track down that my first function above is pulling the meta data from the first post in the blog template, but that didn't get me anywhere.
any ideas?