File: //home/globfdxw/diasporameetsafrica.com/wp-content/themes/lavelo/includes/enqueue-files.php
<?php
/*
* All CSS and JS files are enqueued from this file
* Author & Copyright:Wpoceans
* URL: http://themeforest.net/user/wpoceans
*/
/**
* Enqueue Files for FrontEnd
*/
function lavelo_google_font_url() {
$font_url = '';
if ( 'off' !== esc_html__( 'on', 'lavelo' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Dosis:300,400,500,600,700|Great Vibes' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
if ( ! function_exists( 'lavelo_scripts_styles' ) ) {
function lavelo_scripts_styles() {
// Styles
wp_enqueue_style( 'font-awesome', LAVELO_CSS .'/font-awesome.min.css', array(), '4.6.3', 'all' );
wp_enqueue_style( 'themify-icons', LAVELO_CSS .'/themify-icons.css', array(), '4.6.3', 'all' );
wp_enqueue_style( 'flaticon', LAVELO_CSS .'/flaticon.css', array(), '1.0.0', 'all' );
wp_enqueue_style( 'bootstrap', LAVELO_CSS .'/bootstrap.min.css', array(), '3.3.7', 'all' );
wp_enqueue_style( 'animate', LAVELO_CSS .'/animate.css', array(), '3.5.1', 'all' );
wp_enqueue_style( 'owl-carousel', LAVELO_CSS .'/owl.carousel.css', array(), '2.0.0', 'all' );
wp_enqueue_style( 'slick', LAVELO_CSS .'/slick.css', array(), '1.6.0', 'all' );
wp_enqueue_style( 'slick-theme', LAVELO_CSS .'/slick-theme.css', array(), '1.6.0', 'all' );
wp_enqueue_style( 'magnific-popup', LAVELO_CSS .'/magnific-popup.css', array(), '4.1.0', 'all' );
wp_enqueue_style( 'swiper', LAVELO_CSS .'/swiper.min.css', array(), '4.1.0', 'all' );
wp_enqueue_style( 'lavelo-style', LAVELO_CSS .'/styles.css', array(), LAVELO_VERSION, 'all' );
if ( !function_exists('cs_framework_init') ) {
wp_enqueue_style('lavelo-default-style', get_template_directory_uri() . '/style.css', array(), LAVELO_VERSION, 'all' );
}
wp_enqueue_style( 'lavelo-default-google-fonts', lavelo_google_font_url(), array(), LAVELO_VERSION, 'all' );
// Scripts
wp_enqueue_script( 'bootstrap', LAVELO_SCRIPTS . '/bootstrap.min.js', array( 'jquery' ), '3.3.7', true );
wp_enqueue_script( 'imagesloaded');
wp_enqueue_script( 'isotope', LAVELO_SCRIPTS . '/isotope.min.js', array( 'jquery' ), '2.2.2', true );
wp_enqueue_script( 'owl-carousel', LAVELO_SCRIPTS . '/owl-carousel.js', array( 'jquery' ), '2.0.0', true );
wp_enqueue_script( 'jquery-easing', LAVELO_SCRIPTS . '/jquery-easing.js', array( 'jquery' ), '1.4.0', true );
wp_enqueue_script( 'wow', LAVELO_SCRIPTS . '/wow.min.js', array( 'jquery' ), '1.4.0', true );
wp_enqueue_script( 'magnific-popup', LAVELO_SCRIPTS . '/magnific-popup.js', array( 'jquery' ), '1.1.0', true );
wp_enqueue_script( 'slick-slider', LAVELO_SCRIPTS . '/slick-slider.js', array( 'jquery' ), '1.6.0', true );
wp_enqueue_script( 'swiper', LAVELO_SCRIPTS . '/swiper.min.js', array( 'jquery' ), '4.1.0', true );
wp_enqueue_script( 'countdown', LAVELO_SCRIPTS . '/countdown.js', array( 'jquery' ), '2.2.0', true );
wp_enqueue_script( 'easing', LAVELO_SCRIPTS . '/easing-min.js', array( 'jquery' ), '1.4.0', true );
wp_enqueue_script( 'particleground', LAVELO_SCRIPTS . '/particleground.js', array( 'jquery' ), '2.0.0', true );
wp_enqueue_script( 'particle-app', LAVELO_SCRIPTS . '/particle-app.js', array( 'jquery' ), '2.0.0', true );
wp_enqueue_script( 'spirit', LAVELO_SCRIPTS . '/spirit.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_script( 'surface-shader', LAVELO_SCRIPTS . '/surface-shader.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_script( 'yitplyers', LAVELO_SCRIPTS . '/yitplyers.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_script( 'lavelo-scripts', LAVELO_SCRIPTS . '/scripts.js', array( 'jquery' ), LAVELO_VERSION, true );
// Comments
wp_enqueue_script( 'lavelo-validate-js', LAVELO_SCRIPTS . '/jquery.validate.min.js', array( 'jquery' ), '1.9.0', true );
wp_add_inline_script( 'lavelo-validate-js', 'jQuery(document).ready(function($) {$("#commentform").validate({rules: {author: {required: true,minlength: 2},email: {required: true,email: true},comment: {required: true,minlength: 10}}});});' );
// Responsive Active
$lavelo_viewport = cs_get_option('theme_responsive');
if( !$lavelo_viewport ) {
wp_enqueue_style( 'lavelo-responsive', LAVELO_CSS .'/responsive.css', array(), LAVELO_VERSION, 'all' );
}
// Adds support for pages with threaded comments
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'lavelo_scripts_styles' );
}
/**
* Enqueue Files for BackEnd
*/
if ( ! function_exists( 'lavelo_admin_scripts_styles' ) ) {
function lavelo_admin_scripts_styles() {
wp_enqueue_style( 'lavelo-admin-main', LAVELO_CSS . '/admin-styles.css', true );
wp_enqueue_style( 'flaticon', LAVELO_CSS . '/flaticon.css', true );
wp_enqueue_script( 'lavelo-admin-scripts', LAVELO_SCRIPTS . '/admin-scripts.js', true );
}
add_action( 'admin_enqueue_scripts', 'lavelo_admin_scripts_styles' );
}