Replace Content of Sidebar on Custom Post Type
After a lot of trying and testing, I think I’ve found a solution: add_filter( ‘sidebars_widgets’, ‘exchange_sidebars’, 10); function exchange_sidebars( $sidebars_widgets ){ global $post; // Define the sidebar which should be exchanged $selected_sidebar=”sidebar-1″ // IF we are on a custom post type // AND it is a Child Page (= page has post_parent) // THEN change … Read more