Topic says it all.
My question is, how do I remove/add certain widgets on certain pages (single, mainpage, page and so on)..? All the widgets I need to remove/add are coded by hand in the same functions.php..
Topic says it all.
My question is, how do I remove/add certain widgets on certain pages (single, mainpage, page and so on)..? All the widgets I need to remove/add are coded by hand in the same functions.php..
Added if-function to the widget code tex:
function childtheme_sidebar_search() {
if ( is_home() ) {
code here..
}
}
This seemed to do the trick clean..
Ok, I guess I need to check if widget is active.. otherwise site halts.
Im trolling my own post.. anyways, got it to work (prolly theres some more fancy way of doing this and feel free to post here if you know how)..
function childtheme_sidebar_related() {
if ( is_active_widget('childtheme_sidebar_related') && is_single() ) { ?>
<div id="sidebar_related_posts">
</div><!-- sidebar_related_posts -->
<?php }
}
here is what i came up with. i also have several other functions and invite you to add yours @ Wiki-4-Thematic
function remove_widget_areas($content) {
if ( is_home() ) {
unset($content['1st Subsidiary Aside']);
unset($content['2nd Subsidiary Aside']);
unset($content['3rd Subsidiary Aside']);
unset($content['Index Top']);
}
return $content;
}
add_filter('thematic_widgetized_areas', 'remove_widget_areas');Thanks Danieliser! I'd been trying to code this up myself when I came across this. Brilliant!
You must log in to post.