Esempio n. 1
0
function ts_theme_scripts()
{
    global $smof_data;
    wp_enqueue_script('jquery');
    wp_enqueue_script('device', get_template_directory_uri() . '/js/device.js', array('jquery'), '', true);
    wp_enqueue_script('superfish', get_template_directory_uri() . '/js/superfish.js', array('jquery'), '', true);
    wp_enqueue_script('ts-plugins', get_template_directory_uri() . '/js/plugins.js', array('jquery'), TS_THEME_VERSION, true);
    wp_enqueue_script('magnific-popup', get_template_directory_uri() . '/js/magnific-popup.js', array('jquery'), '', true);
    wp_enqueue_script('googlemaps', 'https://maps.googleapis.com/maps/api/js?sensor=false', array('jquery'), '', true);
    wp_enqueue_script('ts-init', get_template_directory_uri() . '/js/init.js', array('jquery', 'ts-plugins'), TS_THEME_VERSION, true);
    wp_enqueue_script('wp-mediaelement', '', array('jquery'), '', true);
    if (ts_enable_style_selector()) {
        wp_enqueue_script('style-selector', get_template_directory_uri() . '/js/style-selector.js', array('jquery', 'ts-plugins', 'ts-init'), TS_THEME_VERSION, true);
    }
    $params = array('ajaxurl' => admin_url('admin-ajax.php'), 'ajax_nonce' => wp_create_nonce('ts-ajax-nonce'));
    wp_localize_script('jquery', 'ts_ajax_vars', $params);
}
Esempio n. 2
0
    ?>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '<?php 
    echo esc_js($ts_disqus_shortname);
    ?>
'; // required: replace example with your forum shortname
(function($) {
    $(window).load(function() {
        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function () {
            var s = document.createElement('script'); s.async = true;
            s.type = 'text/javascript';
            s.src = '//<?php 
    echo esc_js($ts_disqus_shortname);
    ?>
.disqus.com/count.js';
            (document.getElementsByTagName('BODY')[0]).appendChild(s);
        }());
    });
})(jQuery);
</script>
<?php 
}
if (ts_enable_style_selector()) {
    get_template_part('style_selector');
}
wp_footer();
?>
</body>
</html>