Alter The Main Sidebar Display

function my_custom_sidebar_display( $sidebar ) {
	// Return a different sidebar for custom post type 'gallery'
	if ( is_singular( 'gallery' ) ) {
		return 'my_custom_sidebar_id';
	}
	// Return theme defined sidebar area
	else {
		return $sidebar;
	}
}
add_filter( 'ocean_get_sidebar', 'my_custom_sidebar_display' );

All PHP snippets should be added via a child theme's functions.php file.