How to remove the cufon script from Dzonia Lite theme

I am using Dzonia Lite theme in my website. When I try to remove the cufon script from my functions.php file the sliders that were present in the website are not working.

Colud anyone suggest me how to overcome this issue?

scripts in my functions.php

function inkthemes_wp_enqueue_scripts() {
    if (!is_admin()) {
        wp_enqueue_script('jquery');
        wp_enqueue_script('inkthemes-ddsmoothmenu', get_template_directory_uri() . "/js/ddsmoothmenu.js", array('jquery'));
        wp_enqueue_script('inkthemes-slides', get_template_directory_uri() . "/js/slides.min.jquery.js", array('jquery'));
        wp_enqueue_script('inkthemes-jcarouselite', get_template_directory_uri() . "/js/jcarousellite_1.0.1.js", array('jquery'));
        wp_enqueue_script('inkthemes-confu-ui', get_template_directory_uri() . "/js/cufon-yui.js", array('jquery'));
        wp_enqueue_script('inkthemes-quicksand-confu', get_template_directory_uri() . '/js/mank-sans.cufonfonts.js', array('jquery'));
        wp_enqueue_script('inkthemes-custom', get_template_directory_uri() . '/js/custom.js', array('jquery'));
    } elseif (is_admin()) {
        
    }
}

Related posts

2 comments

  1. You can remove scripts with wp_dequeue_script():

    function wpse99450_remove_cufon() {
        wp_dequeue_script( 'inktheme-confu-ui' );
        // inktheme-confu-ui is the script's handle, according to your posted code
    }
    add_action( 'wp_enqueue_scripts', 'wpse99450_remove_cufon', 20 );
    // set priority to '20' so it will run later than the default
    

    But be careful — as @gdaniel pointed out, if the theme depends on cufon, you will break things.

  2. You can just remove or comment out the line:

    wp_enqueue_script('inkthemes-confu-ui', get_template_directory_uri() . "/js/cufon-yui.js", array('jquery'));
    

    Update:

    You would also need to remove or comment out:

    wp_enqueue_script('inkthemes-quicksand-confu', get_template_directory_uri() . '/js/mank-sans.cufonfonts.js', array('jquery'));
    

    Which is the font cufon is trying to load.

    Custom.js probably makes references to those two lines. You should see something related like this below in your custom.js file.

    Cufon.replace('#cufon-area');
    

    If custom.js has any cufon functions then you will get errors, because it can’t find those functions.

Comments are closed.