Skip to content

Instantly share code, notes, and snippets.

@stanleybz
Created September 19, 2019 10:36
Show Gist options
  • Save stanleybz/60883a09e0e90047f6a4892659e33ee8 to your computer and use it in GitHub Desktop.
Save stanleybz/60883a09e0e90047f6a4892659e33ee8 to your computer and use it in GitHub Desktop.
add_action('litespeed_esi_shortcode-vc_posts_slider', 'enqueue_vc_assets');
add_action('litespeed_esi_shortcode-vc_media_grid', 'enqueue_vc_assets');
function enqueue_vc_assets() {
error_log('enqueue_vc_assets');
if (function_exists('vc_asset_url')) {
wp_register_style( 'flexslider', vc_asset_url( 'lib/bower/flexslider/flexslider.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'vc_pageable_owl-carousel-css', vc_asset_url( 'lib/owl-carousel2-dist/assets/owl.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'prettyphoto', vc_asset_url( 'lib/prettyphoto/css/prettyPhoto.min.css' ), array(), WPB_VC_VERSION );
wp_enqueue_style( 'flexslider' );
wp_enqueue_style( 'prettyphoto' );
wp_enqueue_style( 'vc_pageable_owl-carousel-css' );
wp_enqueue_style( 'animate-css' );
wp_register_script( 'prettyphoto', vc_asset_url( 'lib/prettyphoto/js/jquery.prettyPhoto.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );
wp_register_script( 'flexslider', vc_asset_url( 'lib/bower/flexslider/jquery.flexslider-min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_inline_iframe_js', vc_asset_url( 'js/dist/page_editable.min.js' ), array(
'jquery',
'underscore',
), WPB_VC_VERSION, true );
wp_register_script( 'vc_pageable_owl-carousel', vc_asset_url( 'lib/owl-carousel2-dist/owl.carousel.min.js' ), array(
'jquery',
), WPB_VC_VERSION, true );
wp_register_script( 'vc_grid-js-imagesloaded', vc_asset_url( 'lib/bower/imagesloaded/imagesloaded.pkgd.min.js' ) );
wp_register_script( 'vc_grid', vc_asset_url( 'js/dist/vc_grid.min.js' ), array(
'jquery',
), WPB_VC_VERSION, true );
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_script( 'flexslider' );
wp_enqueue_script( 'vc_inline_iframe_js' );
wp_enqueue_script( 'vc_pageable_owl-carousel' );
wp_enqueue_script( 'vc_grid-js-imagesloaded' );
wp_enqueue_script( 'vc_grid' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment