function optimize() { global $wp_scripts; if (is_admin() || xt_is_login_page()) { return; } $this->js_to_footer('heartbeat'); // JQUERY TO FOOTER //$this->js_to_footer('jquery'); $this->js_to_footer('jquery-migrate'); $this->js_to_footer('jquery-ui-core'); $this->js_to_footer('jquery-ui-widget'); $this->js_to_footer('jquery-ui-mouse'); $this->js_to_footer('jquery-ui-position'); $this->js_to_footer('jquery-ui-draggable'); $this->js_to_footer('jquery-ui-resizable'); $this->js_to_footer('jquery-ui-button'); $this->js_to_footer('jquery-ui-dialog'); // BUDDYPRESS TO FOOTER if (is_plugin_active('buddypress/bp-loader.php')) { $this->js_to_footer('bp-legacy-js'); $this->js_to_footer('bp-confirm'); $this->js_to_footer('jquery-caret'); $this->js_to_footer('jquery-atwho'); $this->js_to_footer('bp-widget-members'); $this->js_to_footer('bp-jquery-query'); $this->js_to_footer('bp-jquery-cookie'); $this->js_to_footer('bp-jquery-scroll-to'); $this->js_to_footer('groups_widget_groups_list-js'); $this->js_to_footer('bbp-default-bbpress'); //bpress old $this->js_to_footer('bbp-default'); //bpress } // MAILCHIMP TO FOOTER if (is_plugin_active('mailchimp-widget/nm_mailchimp.php')) { $this->js_to_footer('mailchimp_ajax'); } // CONTACT FORM 7 TO FOOTER if (is_plugin_active('contact-form-7/wp-contact-form-7.php')) { $this->js_to_footer('contact-form-7'); } // REVSLIDER TO FOOTER if (is_plugin_active('revslider/revslider.php')) { $this->js_to_footer('rs-plugin-settings'); $this->js_to_footer('tp-tools'); $this->js_to_footer('revmin'); } // REVSLIDER TO FOOTER if (is_plugin_active('js_composer/js_composer.php')) { $this->style_to_footer('js_composer_front'); wp_deregister_style('js_composer_custom_css'); } // XT LOGIN / REGISTER $this->style_to_footer('ajax-login-register-style'); $this->style_to_footer('ajax-login-register-login-style'); $this->style_to_footer('ajax-login-register-register-style'); // XT VENDORS $this->style_to_footer('xt-vendors'); }
function enqueue_scripts() { global $wp_scripts; if (is_admin() || xt_is_login_page()) { return; } if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } // MODERNIZR xt_enqueue_script('modernizr', XT_PARENT_URL . '/bower_components/modernizr/modernizr.min.js', null, null, true); // FOUNDATION xt_enqueue_script('xt-foundation', XT_PARENT_URL . '/bower_components/foundation/js/foundation.min.js', null, null, true); if (is_singular()) { // WAYPOINTS wp_dequeue_style('waypoints'); wp_enqueue_script('waypoints', XT_PARENT_URL . '/assets/vendors/waypoints/waypoints.js', array('jquery'), '1.0', true); } // VENDORS xt_enqueue_script('xt-vendors', XT_PARENT_URL . '/assets/js/vendors.min.js', array('jquery'), null, true); // MAIN xt_enqueue_script('xt-theme', XT_PARENT_URL . '/assets/js/theme.min.js', array('jquery'), '1.0', true); // XT VARS $lang_code = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : ''; wp_localize_script('xt-theme', 'xt_vars', array('ajaxurl' => admin_url('admin-ajax.php?lang=' . $lang_code), 'lang' => $lang_code, 'theme_url' => XT_PARENT_URL, 'assets_url' => XT_ASSETS_URL, 'enable_nice_scroll' => xt_option('enable_nice_scroll') == "1" ? true : false, 'enable_smooth_scroll' => xt_option('enable_smooth_scroll') == "1" ? true : false, 'enable_sticky_header' => xt_option('enable_sticky_header') == "1" ? true : false, 'hide_admin_bar' => xt_option('hide_admin_bar') == "1" ? true : false, 'custom_js' => xt_option('custom_js'))); }