Simple way to do some Visual Composer Grid cleanup, when you are using Bootstrap within your theme. This removes and cleans up classes.
add_filter('vc_shortcodes_css_class', function ($class_string, $tag) { $tags_to_clean = [ 'vc_row', 'vc_column', 'vc_row_inner', 'vc_column_inner' ]; // replace vc_, but exclude any custom css // attached via vc_custom_XXX (negative lookahead) // replace all vc_ // $class_string = preg_replace('/vc_/i', '', $class_string); } return $class_string; }, 10, 2);
Visual Composer for WordPress
Bootstrap / Bootstrap Sass
The issue WACOM is known for stopping support for their pen tablets after some years, especially for the cheaper consumer… Read More
Watching from the sidelines VR has not just arrived, but it finally arrived for me and the masses ;) I… Read More
Frohe Ostern aus dem Norden. Da an Urlaub dieses Jahr nicht wirklich zu denken ist, ist Kreatives gefragt! Wie wäre es… Read More
"Visual House erstellt realistische 3D Video-Animationen, Panoramatouren, Außen- und Innen Ansichten für Ihr Bauvorhaben." "Visual House creates realistic 3D video… Read More
"Viktualia liefert an Abholstationen im Raum Heidelberg.Viktualia bündelt für dich das Angebot kleiner und kleinster Höfe aus der Region. Das… Read More
A new passion! VR is a new passion of mine, that I play with in my freetime, but also explore… Read More
View Comments
When you replace "vc_" it removes the background image in a row. Not sure why.
Quick fix: add
$class_string = str_replace('custom_', 'vc_custom_', $class_string);
Alex
Or even better using a negative lookahead :)
$class_string = preg_replace('/vc_(?!custom)/i', '', $class_string);
Updated the above code accordingly.
Enjoy
Alex
Hey Alex, great job! So we can forget about the .container and container-fluid wrapper class from bootstrap or how do you handle that?
Hi,
it will behave just like a standard bootstrap theme. Some tweaks might be needed, depending on addons used or special use cases.
Alex