function willow_data_source_regular_font_faces() { $ret = array(); foreach (willow_get_regular_font_faces() as $font) { $ret[] = array('label' => sprintf(__('Standard : %s', 'willow'), $font), 'value' => $font); } return $ret; }
/** * Enqueue styles and scripts */ function willow_action_enqueue_scripts() { $theme_data = wp_get_theme(); /** * CSS */ // GoogleFonts $font_weights = array(100, 200, 300, 400, 500, 600, 700, 800, 900); $font_styles = array('normal', 'italic'); global $willow_data; foreach ($willow_data['typography_types'] as $type => $label) { if (!in_array(willow_option($type . '_font_face'), willow_get_regular_font_faces())) { VP_Site_GoogleWebFont::instance()->add(willow_option($type . '_font_face'), $font_weights, $font_styles); } } VP_Site_GoogleWebFont::instance()->register(); foreach (VP_Site_GoogleWebFont::instance()->get_names() as $name) { wp_enqueue_style($name); } // Other CSS wp_register_style('willow-bootstrap', WILLOW_CSS . 'bootstrap.willow.min.css', array(), '3.1.1'); wp_register_style('fontawesome', WILLOW_CSS . 'font-awesome.min.css', array(), '4.0.3'); wp_register_style('linecons', WILLOW_CSS . 'linecons.css', array(), '1.0.0'); wp_register_style('animate', WILLOW_CSS . 'animate.css', array(), '3.1.0-dev'); wp_register_style('mediaelement', WILLOW_CSS . 'mediaelementplayer.min.css', array(), '2.14.2'); wp_register_style('willow-jquery-magnific-popup', WILLOW_CSS . 'magnific-popup.willow.css', array(), '0.9.9'); wp_register_style('willow-style', WILLOW_CSS . 'style.css', array('willow-bootstrap', 'fontawesome', 'linecons', 'animate', 'mediaelement', 'willow-jquery-magnific-popup'), $theme_data->get('Version')); wp_enqueue_style('willow-style'); // Dynamic sStyle ob_start(); include WILLOW_CSS_DIR . '/style-dynamic.php'; $dynamic_style = ob_get_clean(); wp_add_inline_style('willow-style', $dynamic_style); wp_add_inline_style('willow-style', willow_option('custom_css')); // Theme stylesheet wp_enqueue_style('style', get_stylesheet_uri()); // WP default stylesheet /** * JS */ // Less than IE9 polyfills global $wp_scripts; wp_register_script('html5shiv', WILLOW_JS . 'html5shiv.js', array(), '3.7.0'); $wp_scripts->add_data('html5shiv', 'conditional', 'lt IE 9'); wp_enqueue_script('html5shiv'); wp_register_script('respond', WILLOW_JS . 'respond.min.js', array(), '1.4.2'); $wp_scripts->add_data('respond', 'conditional', 'lt IE 9'); wp_enqueue_script('respond'); wp_register_script('bootstrap', WILLOW_JS . 'bootstrap.min.js', array('jquery'), '3.1.1'); wp_register_script('smoothscroll', WILLOW_JS . 'smoothscroll.min.js', array('jquery'), '1.2.1'); wp_register_script('jquery-sharrre', WILLOW_JS . 'jquery.sharrre.min.js', array('jquery'), '1.3.5'); wp_register_script('jquery-touchswipe', WILLOW_JS . 'jquery.touchswipe.min.js', array('jquery'), '1.3.3'); wp_register_script('jquery-caroufredsel', WILLOW_JS . 'jquery.caroufredsel-packed.js', array('jquery', 'imagesloaded', 'jquery-touchswipe'), '6.2.1'); wp_register_script('jquery-waypoints', WILLOW_JS . 'waypoints.min.js', array(), '2.0.4'); wp_register_script('jquery-magnific-popup', WILLOW_JS . 'jquery.magnific-popup.min.js', array('jquery'), '0.9.9'); wp_register_script('jquery-parallax', WILLOW_JS . 'jquery.parallax.min.js', array('jquery'), '1.1.3'); wp_register_script('jquery-jpreloader', WILLOW_JS . 'jpreloader.min.js', array('jquery'), '2.1'); wp_register_script('jquery-hoverintent', WILLOW_JS . 'hoverintent.js', array('jquery'), '1.7.4'); wp_register_script('jquery-superfish', WILLOW_JS . 'superfish.js', array('jquery', 'jquery-hoverintent'), '1.7.4'); wp_register_script('jquery-fittext', WILLOW_JS . 'jquery.fittext.js', array('jquery'), '1.2'); wp_register_script('gmap-api', 'http://maps.google.com/maps/api/js?sensor=false'); wp_register_script('jquery-gmap3', WILLOW_JS . 'gmap3.min.js', array('jquery', 'gmap-api'), '6.0.0'); wp_register_script('imagesloaded', WILLOW_JS . 'imagesloaded.pkgd.min.js', array(), '3.1.4'); if (!wp_script_is('isotope', 'registered')) { wp_deregister_script('isotope'); wp_register_script('isotope', WILLOW_JS . 'isotope.pkgd.min.js', array('imagesloaded'), '2.0.0'); } else { willow_append_dependency('isotope', 'imagesloaded'); } wp_register_script('mediaelement', WILLOW_JS . 'mediaelement-and-player.min.js', array('jquery'), '2.14.2'); wp_register_script('countup', WILLOW_JS . 'countup.min.js', array(), '1.1.0'); wp_register_script('willow-modernizr', WILLOW_JS . 'modernizr.willow.min.js', array(), '2.8.1'); wp_register_script('willow-script', WILLOW_JS . 'script.js', array('jquery', 'jquery-waypoints', 'jquery-superfish', 'bootstrap', 'smoothscroll', 'mediaelement', 'jquery-fittext'), $theme_data->get('Version')); wp_enqueue_script('willow-script'); if (willow_option('enable_preloader', 1)) { wp_enqueue_script('jquery-jpreloader'); } $willow_data['localize']['gmap_style_json'] = trim(willow_option('gmap_style_json', '')); $willow_data['localize']['is_mobile_or_tablet'] = Mobile_Detect::is_mobile_or_tablet() ? 'true' : 'false'; wp_localize_script('willow-script', 'willow', $willow_data['localize']); }