Skip to content

Snippet: Hide WPBakery Extra Color Options in Rows, Columns & Text Blocks

The Total theme adds it's own color fields to the WPBakery rows, columns and text blocks. This allows you to choose from your defined color palette. However, because of how WPBakery works we can't just replace their existing color pickers. Thus, you will see both the theme's and WPBakery's when editing these elements. The following code can be added to your child theme functions.php file or via a code snippets plugin to hide the WPBakery color pickers.

// Add inline CSS to hide certain WPB color fields.
function wpwishweb_wpb_editor_css() {
	?>
	<style>
	:is([data-vc-shortcode=vc_section],[data-vc-shortcode=vc_column_text],[data-vc-shortcode=vc_column]) .vc_css-editor .vc_settings label:first-of-type,
	:is([data-vc-shortcode=vc_section],[data-vc-shortcode=vc_column_text],[data-vc-shortcode=vc_column]) .vc_css-editor .color-group{display:none;}
	</style>
	<?php
}
\add_action( 'vc_backend_editor_enqueue_js_css', 'wpwishweb_wpb_editor_css' );
\add_action( 'vc_frontend_editor_enqueue_js_css', 'wpwishweb_wpb_editor_css' );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top