I am using a content block plugin which allows me to use content frequently as a shortcode. The content editor for the shortcode content blocks uses Visual Composer. When I use a created shortcode for a block on a page, most everything works fine except any custom css that is defined in the visual composer shortcode.
For example:
[vc_column_inner width="1/3" css=".vc_custom_1463660338922{background-image: url(/circlebg.png) !important;}”]
The custom css class is defined in the div created in the fronted source, but the definition does not appear in the header. This does work if I do this same process on the page itself without using a shortcode for the content. I believe this has something to do with functions.php. I've changed this function to the following (in bold), but still nothing is recognized :
if(!function_exists('qode_visual_composer_custom_shortcodce_css')){
function qode_visual_composer_custom_shortcodce_css(){
if(qode_visual_composer_installed()){
if(is_page() || is_single() || is_singular('portfolio_page') || is_singular('content_block')){
$shortcodes_custom_css = get_post_meta( qode_get_page_id(), '_wpb_shortcodes_custom_css', true );
if ( ! empty( $shortcodes_custom_css ) ) {
echo '<style type="text/css" data-type="vc_shortcodes-custom-css-'.qode_get_page_id().'">';
echo $shortcodes_custom_css;
echo '</style>';
}
$post_custom_css = get_post_meta( qode_get_page_id(), '_wpb_post_custom_css', true );
if ( ! empty( $post_custom_css ) ) {
echo '<style type="text/css" data-type="vc_custom-css-'.qode_get_page_id().'">';
echo $post_custom_css;
echo '</style>';
}
}
}
}
add_action('qode_visual_composer_custom_shortcodce_css', 'qode_visual_composer_custom_shortcodce_css');
}
Anyone come across this before?
Thank you!