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
Extending iPanorama 360 can be challenge, as none of the events are documented. You can talk to the developer… Read More
WHAT IS IPANORAMA 360? iPanorama 360 for WordPress is specialized plugin that enables users to create and display interactive… Read More
Chatbots Typebot is free and open-source platform that lets you create conversational apps and forms, which can be embedded… Read More
Developer Tools IT Tools is an amazing docker image that gives you access to ton of developer tools for… Read More
I am huge Docker fan and run my own home and cloud server with it. What is Docker? "Docker… Read More
Archaeology Travel is an online travel guide for people who enjoy exploring the world’s pasts. Inspiration for where to go… 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