Esempio n. 1
0
function dynamicnews_enqueue_scripts()
{
    // Get Theme Options from Database
    $theme_options = dynamicnews_theme_options();
    // Register and Enqueue Stylesheet
    wp_enqueue_style('dynamicnewslite-stylesheet', get_stylesheet_uri());
    // Register Genericons
    wp_enqueue_style('dynamicnewslite-genericons', get_template_directory_uri() . '/css/genericons/genericons.css');
    // Register and Enqueue FlexSlider JS and CSS if necessary
    if ((isset($theme_options['slider_activated_blog']) and $theme_options['slider_activated_blog'] == true) || (isset($theme_options['slider_activated_front_page']) and $theme_options['slider_activated_front_page'] == true)) {
        // FlexSlider CSS
        wp_enqueue_style('dynamicnewslite-flexslider', get_template_directory_uri() . '/css/flexslider.css');
        // FlexSlider JS
        wp_enqueue_script('dynamicnewslite-jquery-flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'));
        // Register and enqueue slider.js
        wp_enqueue_script('dynamicnewslite-jquery-frontpage_slider', get_template_directory_uri() . '/js/slider.js', array('dynamicnewslite-jquery-flexslider'));
    }
    // Register and enqueue navigation.js
    wp_enqueue_script('dynamicnewslite-jquery-navigation', get_template_directory_uri() . '/js/navigation.js', array('jquery'));
    // Passing Parameters to Navigation.js Javascript
    wp_localize_script('dynamicnewslite-jquery-navigation', 'dynamicnews_menu_title', esc_html__('Menu', 'dynamic-news-lite'));
    // Register and enqueue sidebar.js
    wp_enqueue_script('dynamicnewslite-jquery-sidebar', get_template_directory_uri() . '/js/sidebar.js', array('jquery'));
    // Register Comment Reply Script for Threaded Comments
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Register and Enqueue Font
    wp_enqueue_style('dynamicnewslite-default-fonts', dynamicnews_fonts_url(), array(), null);
}
Esempio n. 2
0
 function dynamicnews_enqueue_scripts()
 {
     // Get Theme Options from Database
     $theme_options = dynamicnews_theme_options();
     // Register and Enqueue Stylesheet
     wp_enqueue_style('dynamicnewslite-stylesheet', get_stylesheet_uri());
     // Register Genericons
     wp_enqueue_style('dynamicnewslite-genericons', get_template_directory_uri() . '/css/genericons/genericons.css');
     // Register and Enqueue FlexSlider JS and CSS if necessary
     if ((isset($theme_options['slider_activated_blog']) and $theme_options['slider_activated_blog'] == true) || (isset($theme_options['slider_activated_front_page']) and $theme_options['slider_activated_front_page'] == true)) {
         // FlexSlider CSS
         wp_enqueue_style('dynamicnewslite-flexslider', get_template_directory_uri() . '/css/flexslider.css');
         // FlexSlider JS
         wp_enqueue_script('dynamicnewslite-jquery-flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'));
         // Register and enqueue slider.js
         wp_enqueue_script('dynamicnewslite-jquery-frontpage_slider', get_template_directory_uri() . '/js/slider.js', array('dynamicnewslite-jquery-flexslider'));
     }
     // Register and enqueue navigation.js
     wp_enqueue_script('dynamicnewslite-jquery-navigation', get_template_directory_uri() . '/js/navigation.js', array('jquery'));
     // Register and Enqueue Font
     wp_enqueue_style('dynamicnewslite-default-fonts', dynamicnews_fonts_url(), array(), null);
 }