Dynamic Sidebar Conditional [duplicate]

The dynamic sidebar code you are using uses the page title of the topmost page to name the sidebar. get_the_title finds the title of the page you are on, not the topmost page title. You need a function that tells you the title of the topmost page in a page hierarchy.

/**
 * Get the topmost page title.
 *
 * @link http://wordpress.stackexchange.com/questions/107843/dynamic-sidebar-conditional
 */
function wpse_107843_get_top_parent_page_title() {
    global $post;

    $parent_page = get_post( $post->ID );

    // Recurse to top parent.
    while ( $parent_page->post_parent != 0 )
        $parent_page = get_post( $parent_page->post_parent );

    return $parent_page->post_title;
}