Visual Composer / WP Bakery custom CSS styles
-
In the provided shortcode (content_block) and widget (custom_post_widget), WPBakery styles are not being loaded. Please consider incorporating the following code, which will load the CSS specific to a content section or at least provide an action hook that passes in the post ID.
// Load custom CSS from meta data
$shortcodes_custom_css = get_post_meta($post->ID, ‘_wpb_shortcodes_custom_css’, true);// If custom CSS is provided, load inline style.
if (!empty($shortcodes_custom_css))
{
$shortcodes_custom_css = strip_tags($shortcodes_custom_css);
echo ‘<style type=”text/css” data-type=”vc_shortcodes-custom-css”>’;
echo $shortcodes_custom_css;
echo ‘</style>’;
}Kudos to this StackOverflow user for this code. https://stackoverflow.com/a/48914309/7031135
- The topic ‘Visual Composer / WP Bakery custom CSS styles’ is closed to new replies.