I'm trying to get a different sidebar to load within child pages of a particular parent without the use of a plugin or setting up another template file.
This is what I have so far:
register_sidebars(1, array(
'name' => 'Other Sidebar',
'id' => "other-sidebar",
'before_widget' => '<li class="widget">',
'after_widget' => '</li>',
'before_title' => '<span class="widgettitle">',
'after_title' => '</span>'
));
if ( $post->post_parent == '1164' ) {
dynamic_sidebar( 'other-sidebar' );
}
But I'm wondering if I need use a filter of some sort to replace the default sidebar that is being loaded instead? Not too sure if that's correct or not.