예제 #1
0
function themify_theme_enqueue_scripts()
{
    ///////////////////
    //Enqueue styles
    ///////////////////
    //Themify base styling
    wp_enqueue_style('theme-style', get_stylesheet_uri(), array(), wp_get_theme()->display('Version'));
    //Themify Media Queries CSS
    wp_enqueue_style('themify-media-queries', THEME_URI . '/media-queries.css');
    ///////////////////
    //Enqueue scripts
    ///////////////////
    //Themify internal scripts
    wp_enqueue_script('theme-script', THEME_URI . '/js/themify.script.js', array('jquery'), false, true);
    //Inject variable values in gallery script
    wp_localize_script('theme-script', 'themifyScript', array('lightbox' => themify_lightbox_vars_init(), 'lightboxContext' => apply_filters('themify_lightbox_context', '#pagewrap'), 'isTouch' => themify_is_touch() ? 'true' : 'false'));
    //WordPress internal script to move the comment box to the right place when replying to a user
    if (is_single() || is_page()) {
        wp_enqueue_script('comment-reply');
    }
}
예제 #2
0
/**
 * Enqueue Stylesheets and Scripts
 * @since 1.0.0
 */
function themify_theme_enqueue_scripts()
{
    // Get theme version for Themify theme scripts and styles
    $theme_version = wp_get_theme()->display('Version');
    // check scrolling effect
    $scrollingEffect = themify_is_transition_active();
    ///////////////////
    //Enqueue styles
    ///////////////////
    // Themify base styling
    wp_enqueue_style('theme-style', get_stylesheet_uri(), array(), $theme_version);
    // Themify Media Queries CSS
    wp_enqueue_style('themify-media-queries', THEME_URI . '/media-queries.css', array(), $theme_version);
    // Google Web Fonts embedding
    wp_enqueue_style('google-fonts', themify_https_esc('http://fonts.googleapis.com/css') . '?family=Josefin+Sans&subset=latin,latin-ext');
    ///////////////////
    //Enqueue scripts
    ///////////////////
    // Excanvas
    wp_enqueue_script('themify-excanvas', THEME_URI . '/js/excanvas.js', array(), false, true);
    // Easy pie chart
    wp_enqueue_script('themify-easy-pie-chart', THEME_URI . '/js/jquery.easy-pie-chart.js', array('jquery'), '1.2.1', true);
    // Waypoints plugin
    wp_enqueue_script('themify-waypoints', THEME_URI . '/js/waypoints.min.js', array('jquery'), $theme_version, true);
    // Themify Scroll plugin
    wp_enqueue_script('themify-section-highlight', THEME_URI . '/js/themify.section-highlight.js', array('jquery'), $theme_version, true);
    // Themify internal scripts
    wp_enqueue_script('theme-script', THEME_URI . '/js/themify.script.js', array('jquery'), $theme_version, true);
    // Themify gallery
    wp_enqueue_script('themify-gallery', THEMIFY_URI . '/js/themify.gallery.js', array('jquery'), false, true);
    // Inject variable values in gallery script
    wp_localize_script('theme-script', 'themifyScript', array('lightbox' => themify_lightbox_vars_init(), 'lightboxContext' => apply_filters('themify_lightbox_context', '#pagewrap'), 'isTouch' => themify_is_touch() ? 'true' : 'false', 'fixedHeader' => themify_check('setting-fixed_header_disabled') ? '' : 'fixed-header', 'chart' => apply_filters('themify_chart_init_vars', array('trackColor' => '#f2f2f2', 'scaleColor' => false, 'lineCap' => 'butt', 'rotate' => 0, 'size' => 170, 'lineWidth' => 22, 'animate' => 2000)), 'scrollingEffectOn' => $scrollingEffect, 'transitionSetup' => apply_filters('themify_transition_setup', array('selectors' => array('.section-post .shortcode.list-posts', '.section-post .shortcode.team', '.section-post .shortcode.portfolio', '.section-post .shortcode.highlight', '.section-post .module-portfolio', '.section-post .module-highlight', '.shortcode.col4-3', '.shortcode.col4-2', '.shortcode.col4-1', '.shortcode.col3-2', '.shortcode.col3-1', '.shortcode.col2-1', 'body:not(.query-section) .loops-wrapper.list-post', 'body:not(.query-section) .loops-wrapper.grid4', 'body:not(.query-section) .loops-wrapper.grid3', 'body:not(.query-section) .loops-wrapper.grid2', 'body:not(.query-section) .loops-wrapper.grid2-thumb', 'body:not(.query-section) .loops-wrapper.list-thumb-image', '.section-post .themify_builder_row'), 'specificSelectors' => array('.section-post .button' => 'fade-in', '.timeline .timeline-date' => 'fade-in', '.timeline .timeline-content' => 'slide-up'), 'effect' => themify_check('setting-transition_effect_fadein') ? 'fade-in' : 'fly-in'))));
    // WordPress internal script to move the comment box to the right place when replying to a user
    if (is_single() || is_page()) {
        wp_enqueue_script('comment-reply');
    }
}
/**
 * Enqueue Stylesheets and Scripts
 * @since 1.0.0
 */
function themify_theme_enqueue_scripts()
{
    global $themify;
    // Get theme version for Themify theme scripts and styles
    $theme_version = wp_get_theme()->display('Version');
    $font = themify_area_design('font', array('default' => '', 'values' => wp_list_pluck(themify_theme_font_design_options(), 'value')));
    $color = themify_area_design('color', array('default' => '', 'values' => wp_list_pluck(themify_theme_color_design_options(), 'value')));
    $design_preset_dependency = array('theme-style');
    ///////////////////
    //Enqueue styles
    ///////////////////
    // Google Web Fonts embedding
    $google_fonts = '?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700|Sorts+Mill+Goudy:400,400italic|Raleway:400,300,500,700';
    if ($font == 'theme-font-slab' || $font == 'theme-font-slab-sans') {
        $google_fonts .= '|Roboto+Slab:300,700,400&subset=latin,latin-ext';
    }
    wp_enqueue_style('google-fonts', themify_https_esc('http://fonts.googleapis.com/css') . $google_fonts);
    // Themify base styling
    wp_enqueue_style('theme-style', get_stylesheet_uri(), array(), $theme_version);
    // Themify Media Queries CSS
    wp_enqueue_style('themify-media-queries', THEME_URI . '/media-queries.css', array(), $theme_version);
    if (themify_is_using_custom_setting('font_design') || themify_is_using_custom_setting('color_design')) {
        if ($GLOBALS['themify_customizer']->test_and_enqueue()) {
            $design_preset_dependency[] = 'themify-customize';
        }
    }
    if ($color != '' && $color != 'default') {
        wp_enqueue_style($color, THEME_URI . '/styles/' . $color . '.css', $design_preset_dependency);
    }
    if ($font != '' && $font != 'default') {
        wp_enqueue_style($font, THEME_URI . '/styles/' . $font . '.css', $design_preset_dependency);
    }
    ///////////////////
    //Enqueue scripts
    ///////////////////
    // Smooth scroll and scrollbar
    wp_enqueue_script('themify-nicescroll', THEME_URI . '/js/jquery.nicescroll.js', array('jquery'), $theme_version, true);
    // Slide mobile navigation menu
    wp_enqueue_script('slide-nav', THEMIFY_URI . '/js/themify.sidemenu' . themify_minified() . '.js', array('jquery'), $theme_version, true);
    // Masonry layout
    wp_enqueue_script('themify-isotope', THEME_URI . '/js/jquery.isotope.min.js', array(), $theme_version, true);
    if ((is_home() || is_archive() || themify_is_query_page() || is_search()) && 'slider' !== $themify->post_layout) {
        // Infinite scroll
        wp_enqueue_script('infinitescroll', THEME_URI . '/js/jquery.infinitescroll.min.js', array('jquery'), false, true);
    }
    // Carousel
    if ('slider' === $themify->post_layout) {
        wp_enqueue_script('themify-carousel-js');
    }
    // Themify internal scripts
    wp_enqueue_script('theme-script', THEME_URI . '/js/themify.script' . themify_minified() . '.js', array('jquery'), $theme_version, true);
    // Themify Gallery
    wp_enqueue_script('themify-gallery', THEMIFY_URI . '/js/themify.gallery.js', array('jquery'), false, true);
    // Backstretch for header slider
    wp_register_script('themify-backstretch', THEME_URI . '/js/backstretch.js', array('jquery'), false, true);
    // Header video
    wp_register_script('themify-videojs-js', THEMIFY_URI . '/js/video.js', array('jquery'));
    wp_register_script('themify-bigvideo-js', THEMIFY_URI . '/js/bigvideo.js', array('themify-videojs-js'));
    global $wp_query;
    // Prepare JS variables
    $themify_script_vars = array('lightbox' => themify_lightbox_vars_init(), 'lightboxContext' => apply_filters('themify_lightbox_context', '#pagewrap'), 'isTouch' => themify_is_touch() ? 'true' : 'false', 'fixedHeader' => themify_theme_fixed_header(), 'ajax_nonce' => wp_create_nonce('ajax_nonce'), 'ajax_url' => admin_url('admin-ajax.php'), 'smallScreen' => '760', 'resizeRefresh' => '250', 'parallaxHeader' => apply_filters('themify_parallax_header', true), 'colorAnimation' => themify_check('setting-color_animation_enabled') ? 'animated-bg' : '', 'colorAnimationSpeed' => themify_check('setting-color_animation_speed') ? (int) themify_get('setting-color_animation_speed') * 1000 : '5000', 'loadingImg' => THEME_URI . '/images/loading.gif', 'maxPages' => $wp_query->max_num_pages, 'autoInfinite' => themify_check('setting-autoinfinite') ? 'no' : 'auto', 'scrollToNewOnLoad' => 'scroll', 'resetFilterOnLoad' => 'reset');
    // Set colors for color animation
    $color_key = 'setting-color_stop_';
    $colors = array();
    for ($i = 1; $i <= 7; $i++) {
        if (themify_check($color_key . $i)) {
            $colors[] = '#' . themify_get($color_key . $i);
        }
    }
    // If there are no colors set in theme settings, use default colors
    if (empty($colors)) {
        $colors = themify_theme_animated_bg_default_colors();
    }
    // Assign set of colors to pass to JavaScript
    $themify_script_vars['colorAnimationSet'] = implode(',', $colors);
    // Enqueue color animation script
    wp_enqueue_script('themify-animated-bg', THEMIFY_URI . '/js/animated-bg.js', array('jquery', 'theme-script', 'jquery-ui-core', 'jquery-effects-core'), THEMIFY_VERSION, true);
    // Pass variable values to JavaScript
    wp_localize_script('theme-script', 'themifyScript', apply_filters('themify_script_vars', $themify_script_vars));
    // Collect page variables or use defaults
    $page_id = get_queried_object_id();
    if ($page_id != null) {
        $slider_play = get_post_meta($page_id, 'background_auto', true) ? get_post_meta($page_id, 'background_auto', true) : (themify_check('setting-footer_slider_auto') ? themify_get('setting-footer_slider_auto') : 'yes');
        $slider_autoplay = get_post_meta($page_id, 'background_autotimeout', true) ? get_post_meta($page_id, 'background_autotimeout', true) : (themify_check('setting-footer_slider_autotimeout') ? themify_get('setting-footer_slider_autotimeout') : 5);
        $slider_speed = get_post_meta($page_id, 'background_speed', true) ? get_post_meta($page_id, 'background_speed', true) : (themify_check('setting-footer_slider_speed') ? themify_get('setting-footer_slider_speed') : 500);
        $slider_wrap = get_post_meta($page_id, 'background_wrap', true) ? get_post_meta($page_id, 'background_wrap', true) : 'yes';
    } else {
        $slider_play = 'yes';
        $slider_autoplay = 5;
        $slider_speed = 500;
        $slider_wrap = 'yes';
    }
    // Header gallery
    wp_register_script('header-slider', THEME_URI . '/js/themify.header-slider' . themify_minified() . '.js', array('jquery', 'themify-carousel-js', 'themify-backstretch'), false, true);
    //Inject variable values in gallery script
    wp_localize_script('header-slider', 'themifyVars', array('play' => $slider_play, 'autoplay' => $slider_autoplay, 'speed' => $slider_speed, 'wrap' => $slider_wrap));
    // WordPress internal script to move the comment box to the right place when replying to a user
    if (is_single() || is_page()) {
        wp_enqueue_script('comment-reply');
    }
}
예제 #4
0
 /**
  * Register styles and scripts necessary for Builder template output.
  * These are enqueued when user initializes Builder or from a template output.
  *
  * Registered style handlers:
  *
  * Registered script handlers:
  * themify-builder-module-plugins-js
  * themify-builder-script-js
  *
  * @since 2.1.9
  */
 function register_frontend_js_css()
 {
     // Builder main scripts
     wp_enqueue_style('themify-builder-style', THEMIFY_BUILDER_URI . '/css/themify-builder-style.css', array(), THEMIFY_VERSION);
     wp_register_script('themify-builder-module-plugins-js', THEMIFY_BUILDER_URI . '/js/themify.builder.module.plugins.js', array('jquery'), THEMIFY_VERSION, true);
     wp_enqueue_script('themify-builder-module-plugins-js');
     wp_localize_script('themify-builder-module-plugins-js', 'tbLocalScript', apply_filters('themify_builder_script_vars', array('isTouch' => themify_is_touch() ? true : false, 'isAnimationActive' => Themify_Builder_Model::is_animation_active(), 'isParallaxActive' => Themify_Builder_Model::is_parallax_active(), 'animationInviewSelectors' => self::$inview_selectors, 'createAnimationSelectors' => self::$new_selectors, 'backgroundSlider' => array('autoplay' => 5000, 'speed' => 2000), 'animationOffset' => 100, 'videoPoster' => THEMIFY_BUILDER_URI . '/img/blank.png', 'backgroundVideoLoop' => 'yes', 'builder_url' => THEMIFY_BUILDER_URI, 'framework_url' => THEMIFY_URI, 'version' => THEMIFY_VERSION, 'fullwidth_support' => $this->is_fullwidth_layout_supported(), 'fullwidth_container' => 'body', 'loadScrollHighlight' => true)));
     //Inject variable values in gallery script
     wp_localize_script('themify-builder-module-plugins-js', 'themifyScript', array('lightbox' => themify_lightbox_vars_init(), 'lightboxContext' => apply_filters('themify_lightbox_context', 'body'), 'isTouch' => wp_is_mobile() ? 'true' : 'false'));
     //Inject variable values in Scroll-Highlight script
     wp_localize_script('themify-builder-module-plugins-js', 'tbScrollHighlight', apply_filters('themify_builder_scroll_highlight_vars', array('fixedHeaderSelector' => '', 'speed' => 900, 'navigation' => '#main-nav', 'scrollOffset' => 0)));
     ////Enqueue main js that will load others needed js
     wp_register_script('themify-main-script', THEMIFY_URI . '/js/main.js', array('jquery'), THEMIFY_VERSION, true);
     wp_localize_script('themify-main-script', 'themify_vars', array('version' => THEMIFY_VERSION, 'url' => THEMIFY_URI, 'TB' => 1));
     wp_enqueue_script('themify-main-script');
 }
/**
 * Enqueue Stylesheets and Scripts
 */
function themify_theme_enqueue_scripts()
{
    global $wp_query;
    $theme_version = wp_get_theme()->display('Version');
    // Themify base styling
    wp_enqueue_style('theme-style', get_stylesheet_uri(), array(), $theme_version);
    // Themify Media Queries CSS
    wp_enqueue_style('themify-media-queries', THEME_URI . '/media-queries.css');
    //Google Web Fonts embedding
    wp_enqueue_style('google-fonts', themify_https_esc('http://fonts.googleapis.com/css') . '?family=Crete+Round|Vidaloka|Alice');
    // Themify Icons
    wp_enqueue_style('themify-icons', THEME_URI . '/themify/themify-icons/themify-icons.css', array(), $theme_version);
    // Enqueue scripts ////////////////////////////////////////////
    $scripts = array('isotope', 'infinitescroll', 'backstretch');
    foreach ($scripts as $js) {
        wp_enqueue_script('themify-' . $js, THEME_URI . '/js/' . $js . '.js', array('jquery'), false, true);
    }
    // Check scrolling and transition effect
    $scrollingEffect = true;
    $scrollingEffectType = themify_get('section_parallax_effect') != '' ? themify_get('section_parallax_effect') : 'effect2';
    $transitionEffect = true;
    if (themify_get('setting-scrolling_effect_mobile_exclude') != 'on' && themify_is_touch() || themify_check('setting-scrolling_effect_all_disabled')) {
        $scrollingEffect = false;
    }
    // check fly-in/fade-in animation
    if (themify_get('setting-transition_effect_mobile_exclude') != 'on' && themify_is_touch() || themify_check('setting-transition_effect_all_disabled')) {
        $transitionEffect = false;
    }
    // Initialize carousel
    wp_enqueue_script('themify-carousel-js');
    // Themify waypoints
    wp_enqueue_script('theme-waypoints', THEME_URI . '/js/waypoints.min.js', array('jquery'), false, true);
    // Themify Auto Iframe Height
    wp_enqueue_script('theme-auto-iframe-height', THEME_URI . '/js/jquery.iframe-auto-height.js', array('jquery'), false, true);
    // Fullscreen header video
    if (!wp_script_is('themify-bigvideo-js')) {
        wp_enqueue_script('themify-videojs-js', THEMIFY_URI . '/js/video.js', array('jquery'));
        wp_enqueue_script('themify-bigvideo-js', THEMIFY_URI . '/js/bigvideo.js', array('themify-videojs-js'));
    }
    // Themify internal scripts
    wp_enqueue_script('theme-script', THEME_URI . '/js/themify.script.js', array('jquery', 'themify-backstretch'), false, true);
    //Themify Gallery
    wp_enqueue_script('themify-gallery', THEMIFY_URI . '/js/themify.gallery.js', array('jquery'), false, true);
    // Get auto infinite scroll setting
    $autoinfinite = '';
    if (!themify_get('setting-autoinfinite')) {
        $autoinfinite = 'auto';
    }
    //Inject variable values in gallery script
    wp_localize_script('theme-script', 'themifyScript', array('lightbox' => themify_lightbox_vars_init(), 'lightboxContext' => apply_filters('themify_lightbox_context', '#pagewrap'), 'isTouch' => themify_is_touch() ? 'true' : 'false', 'loadingImg' => THEME_URI . '/images/loading.gif', 'maxPages' => $wp_query->max_num_pages, 'autoInfinite' => $autoinfinite, 'fixedHeader' => apply_filters('themify_fixed_header', true), 'ajaxurl' => admin_url('admin-ajax.php'), 'load_nonce' => wp_create_nonce('theme_load_nonce'), 'transitionEffect' => $transitionEffect, 'transitionSetup' => apply_filters('themify_transition_setup', array('selectors' => array('.section-post .section-content > .shortcode.list-posts', '.section-post .section-content > .shortcode.team', '.section-post .section-content > .shortcode.portfolio', '.section-post .section-content > .shortcode.highlight', '.section-post .module-portfolio', '.section-post .module-highlight', '.shortcode.col4-3', '.shortcode.col4-2', '.shortcode.col4-1', '.shortcode.col3-2', '.shortcode.col3-1', '.shortcode.col2-1', 'body:not(.query-section) .loops-wrapper.list-post', 'body:not(.query-section) .loops-wrapper.grid4', 'body:not(.query-section) .loops-wrapper.grid3', 'body:not(.query-section) .loops-wrapper.grid2', 'body:not(.query-section) .loops-wrapper.grid2-thumb'), 'effect' => themify_check('setting-transition_effect_fadein') ? 'fade-in' : 'fly-in')), 'scrollingEffect' => $scrollingEffect, 'scrollingEffectType' => $scrollingEffectType, 'scrollingEasing' => !themify_get('setting-scrolling_effect_easing') ? 'linear' : themify_get('setting-scrolling_effect_easing'), 'chart' => apply_filters('themify_chart_init_vars', array('trackColor' => 'rgba(0,0,0,.1)', 'scaleColor' => false, 'lineCap' => 'butt', 'rotate' => 0, 'size' => 175, 'lineWidth' => 3, 'animate' => 2000)), 'headerScroll' => apply_filters('themify_parallax_header_scroll', array('adjust' => 0, 'ratio' => -0.3))));
    // Collect page variables or use defaults
    $page_id = get_queried_object_id();
    if ($page_id != null) {
        $slider_play = get_post_meta($page_id, 'background_auto', true) ? get_post_meta($page_id, 'background_auto', true) : (themify_check('setting-footer_slider_auto') ? themify_get('setting-footer_slider_auto') : 'yes');
        $slider_autoplay = get_post_meta($page_id, 'background_autotimeout', true) ? get_post_meta($page_id, 'background_autotimeout', true) : (themify_check('setting-footer_slider_autotimeout') ? themify_get('setting-footer_slider_autotimeout') : 5);
        $slider_speed = get_post_meta($page_id, 'background_speed', true) ? get_post_meta($page_id, 'background_speed', true) : (themify_check('setting-footer_slider_speed') ? themify_get('setting-footer_slider_speed') : 500);
        $slider_wrap = get_post_meta($page_id, 'background_wrap', true) ? get_post_meta($page_id, 'background_wrap', true) : 'yes';
    } else {
        $slider_play = 'yes';
        $slider_autoplay = 5;
        $slider_speed = 500;
        $slider_wrap = 'yes';
    }
    // Header gallery
    wp_enqueue_script('gallery-script', THEME_URI . '/js/themify.gallery.js', array('jquery'), false, true);
    //Inject variable values in gallery script
    wp_localize_script('gallery-script', 'themifyVars', array('play' => $slider_play, 'autoplay' => $slider_autoplay, 'speed' => $slider_speed, 'wrap' => $slider_wrap));
    // Section slider
    wp_enqueue_script('slider-section', THEME_URI . '/js/themify.slidersection.js', array('jquery'), false, true);
    //Inject variable values in section slider script
    wp_localize_script('slider-section', 'themifySectionVars', array('play' => $slider_play, 'autoplay' => $slider_autoplay, 'speed' => $slider_speed, 'wrap' => $slider_wrap));
    // Easy pie chart
    wp_enqueue_script('themify-easy-pie-chart', THEME_URI . '/js/jquery.easy-pie-chart.js', array('jquery'), $theme_version, true);
    //WordPress internal script to move the comment box to the right place when replying to a user
    if (is_single() || is_page()) {
        wp_enqueue_script('comment-reply');
    }
}
예제 #6
0
/**
 * Enqueue Stylesheets and Scripts
 */
function themify_theme_enqueue_scripts()
{
    global $wp_query;
    // Themify base styling
    wp_enqueue_style('theme-style', get_stylesheet_uri(), array(), wp_get_theme()->display('Version'));
    // Themify Media Queries CSS
    wp_enqueue_style('themify-media-queries', THEME_URI . '/media-queries.css');
    // User stylesheet
    if (is_file(TEMPLATEPATH . "/custom_style.css")) {
        wp_enqueue_style('custom-style', THEME_URI . '/custom_style.css');
    }
    //Google Web Fonts embedding
    wp_enqueue_style('google-fonts', 'http://fonts.googleapis.com/css?family=Crete+Round|Vidaloka|Alice');
    // Enqueue scripts ////////////////////////////////////////////
    $scripts = array('isotope', 'infinitescroll', 'backstretch');
    foreach ($scripts as $js) {
        wp_enqueue_script('themify-' . $js, THEME_URI . '/js/' . $js . '.js', array('jquery'), false, true);
    }
    // Check scrolling effect
    $scrollingEffect = 'enabled';
    $scrollingEffectType = themify_get('section_parallax_effect') != '' ? themify_get('section_parallax_effect') : 'effect2';
    if (themify_get('setting-scrolling_effect_mobile_exclude') != 'on' && themify_is_mobile() || themify_check('setting-scrolling_effect_all_disabled')) {
        $scrollingEffect = 'disabled';
    }
    // Check transition Effect, only enqueue skroll when transition active
    if (themify_get('setting-transition_effect_mobile_exclude') != 'on' && themify_is_mobile() || themify_check('setting-transition_effect_all_disabled')) {
        // nothing
    } else {
        wp_enqueue_script('themify-skrollr', THEME_URI . '/js/skrollr.js', array('jquery'), false, true);
    }
    if ($scrollingEffectType == 'effect2') {
        wp_enqueue_script('themify-parallax', THEME_URI . '/js/jquery.parallax.js', array('jquery'), false, true);
    }
    wp_enqueue_script('bootstrap', THEME_URI . '/js/bootstrap.js', array('jquery'), false, true);
    // Initialize carousel
    wp_enqueue_script('themify-carousel-js');
    // Themify internal scripts
    wp_enqueue_script('theme-script', THEME_URI . '/js/themify.script.js', array('jquery', 'themify-backstretch'), false, true);
    //Themify Gallery
    wp_enqueue_script('themify-gallery', THEMIFY_URI . '/js/themify.gallery.js', array('jquery'), false, true);
    // Get auto infinite scroll setting
    $autoinfinite = '';
    if (!themify_get('setting-autoinfinite')) {
        $autoinfinite = 'auto';
    }
    //Inject variable values in gallery script
    wp_localize_script('theme-script', 'themifyScript', array('lightbox' => themify_lightbox_vars_init(), 'lightboxContext' => apply_filters('themify_lightbox_context', '#pagewrap'), 'loadingImg' => THEME_URI . '/images/loading.gif', 'maxPages' => $wp_query->max_num_pages, 'autoInfinite' => $autoinfinite, 'fixedHeader' => apply_filters('themify_fixed_header', true), 'ajaxurl' => admin_url('admin-ajax.php'), 'load_nonce' => wp_create_nonce('theme_load_nonce'), 'transitionSetup' => themify_get_transition_setup(), 'scrollingEffect' => $scrollingEffect, 'scrollingEffectType' => $scrollingEffectType));
    // Header gallery
    wp_enqueue_script('gallery-script', THEME_URI . '/js/themify.gallery.js', array('jquery'), false, true);
    //Inject variable values in gallery script
    wp_localize_script('gallery-script', 'themifyVars', array('play' => !themify_get('setting-footer_slider_auto') ? 'yes' : themify_get('setting-footer_slider_auto'), 'autoplay' => !themify_get('setting-footer_slider_autotimeout') ? 5 : themify_get('setting-footer_slider_autotimeout'), 'speed' => !themify_get('setting-footer_slider_speed') ? 500 : themify_get('setting-footer_slider_speed')));
    //WordPress internal script to move the comment box to the right place when replying to a user
    if (is_single() || is_page()) {
        wp_enqueue_script('comment-reply');
    }
}