Remove the search results sidebar in the OceanWP theme

Remove the search results sidebar in the OceanWP theme on child sites.

Snippet Type

Execute on Child Sites

Snippet

function remove_search_sidebar( $layout ) {
	if ( is_search() ) {
		$layout = 'full-width';
	}
	return $layout;
}
add_filter( 'ocean_post_layout_class', 'remove_search_sidebar', 20 );