function ld_data_source_regular_font_faces()
{
    $ret = array();
    foreach (ld_get_regular_font_faces() as $font) {
        $ret[] = array('label' => sprintf(__('Standard : %s', 'lovey_dovey'), $font), 'value' => $font);
    }
    return $ret;
}
Esempio n. 2
0
/**
 * Embed Scripts into Page
 */
function ld_theme_scripts()
{
    $theme_data = wp_get_theme();
    /**
     * CSS
     */
    // Theme stylesheet
    wp_enqueue_style('style', get_stylesheet_uri());
    // WP default stylesheet
    // GoogleFonts
    global $lovey_dovey_data;
    $font_weights = array(100, 200, 300, 400, 500, 600, 700, 800, 900);
    $font_styles = array('normal', 'italic');
    foreach ($lovey_dovey_data['typography_types'] as $type => $label) {
        if (!in_array(ld_option($type . '_font_face'), ld_get_regular_font_faces())) {
            VP_Site_GoogleWebFont::instance()->add(ld_option($type . '_font_face'), $font_weights, $font_styles);
        }
    }
    VP_Site_GoogleWebFont::instance()->register_and_enqueue();
    // Other CSS
    // wp_register_style( 'bootstrap', LD_CSS . 'bootstrap.min.css', array(), '3.1.1' );
    wp_register_style('bootstrap-ld', LD_CSS . 'bootstrap.ld.css', array(), '3.1.1');
    wp_register_style('fontawesome', LD_CSS . 'font-awesome.min.css', array(), '4.0.3');
    wp_register_style('linecons', LD_CSS . 'linecons.css', array(), '1.0.0');
    wp_register_style('socmed', LD_CSS . 'socmed.css', array());
    wp_register_style('countdown', LD_CSS . 'jquery.countdown.css', array());
    wp_register_style('jquery-magnific-popup', LD_CSS . 'magnific-popup.css', array(), '0.9.9');
    wp_register_style('jquery-justifiedgallery', LD_CSS . 'justifiedgallery.min.css', array(), '3.2.0');
    wp_register_style('ld-style', LD_CSS . 'style.css', array('bootstrap-ld', 'fontawesome', 'linecons', 'socmed', 'countdown', 'jquery-magnific-popup', 'jquery-justifiedgallery'), $theme_data->get('Version'));
    wp_enqueue_style('ld-style');
    // Dynamic Style
    ob_start();
    include LD_CSS_DIR . '/style-dynamic.php';
    $dynamic_style = ob_get_clean();
    wp_add_inline_style('ld-style', $dynamic_style);
    wp_add_inline_style('ld-style', ld_option('custom_css'));
    /**
     * JS
     */
    wp_enqueue_script('modernizr', LD_JS . 'modernizr-latest.js');
    wp_register_script('bootstrap', LD_JS . 'bootstrap.min.js', array('jquery'), '3.1.1');
    wp_register_script('smoothscroll', LD_JS . 'smoothscroll.min.js', array('jquery'), '1.2.1');
    wp_register_script('jquery-backstretch', LD_JS . 'jquery.backstretch.min.js', array('jquery'), '2.0.4');
    wp_register_script('jquery-plugin', LD_JS . 'jquery.plugin.min.js', array('jquery'));
    wp_register_script('jquery-countdown', LD_JS . 'jquery.countdown.min.js', array('jquery', 'jquery-plugin'));
    wp_register_script('jquery-parallax', LD_JS . 'jquery.parallax.min.js', array('jquery'), '1.1.3');
    wp_register_script('jquery-countdown-br', LD_JS . 'jquery.countdown.pt-BR.js', array('jquery'), '2.0.0');
    wp_register_script('jquery-magnific-popup', LD_JS . 'jquery.magnific-popup.min.js', array('jquery'), '0.9.9');
    wp_register_script('jquery-justifiedgallery', LD_JS . 'jquery.justifiedgallery.min.js', array('jquery', 'jquery-magnific-popup'), '3.2.0');
    wp_register_script('jquery-waypoints', LD_JS . 'waypoints.min.js', array(), '2.0.4');
    wp_register_script('imagesloaded', LD_JS . 'imagesloaded.pkgd.min.js', array(), '3.1.4');
    wp_register_script('gmap-api', 'http://maps.google.com/maps/api/js?sensor=false');
    wp_register_script('jquery-gmap3', LD_JS . 'gmap3.min.js', array('jquery', 'gmap-api'), '6.0.0');
    wp_deregister_script('isotope');
    wp_register_script('isotope', LD_JS . 'isotope.pkgd.min.js', array('imagesloaded'), '2.0.0');
    wp_register_script('ld-script', LD_JS . 'script.js', array('jquery', 'bootstrap', 'smoothscroll', 'jquery-backstretch', 'jquery-countdown', 'jquery-magnific-popup', 'jquery-justifiedgallery', 'jquery-waypoints', 'jquery-gmap3', 'isotope', 'jquery-countdown-br'), $theme_data->get('Version'));
    wp_enqueue_script('ld-script');
    wp_localize_script('ld-script', 'loveydovey', array('gb_name_id' => ld_option('gb_name_id'), 'gb_message_id' => ld_option('gb_message_id'), 'is_mobile_or_tablet' => Mobile_Detect::is_mobile_or_tablet() ? 'true' : 'false'));
}