Disabling the Audio Player

Viewing 4 posts - 1 through 4 (of 4 total)
  • #14198
    Jared
    Participant

    While running some speed tests on my site I noticed that

    http://www.mywebsite.com/wp-content/themes/esplanade/scripts/audio-player…

    is the slowest thing to load on the site. Mostly just waiting. I never have and never will use the audio-player. Can this just be deleted or disabled (via the custom CSS under the design tab).

    Anyone know?

    #14199
    Jared
    Participant

    oh and if it is disableable via the custom CSS under the design tab… anyone know what the script would look like to do that?

    #14210
    pdyw7sjy4xpy4eqz
    Participant

    Edit functions.php, search for

    function esplanade_register_scripts() {
    wp_register_script( 'flexslider', get_template_directory_uri() . '/scripts/jquery.flexslider-min.js', array( 'jquery' ), null );
    wp_register_script( 'colorbox', get_template_directory_uri() . '/scripts/colorbox.js', array( 'jquery-migrate' ), null );
    wp_register_script( 'fitvids', get_template_directory_uri() . '/scripts/fitvids.js', array( 'jquery' ), null );
    wp_register_script( 'audio-player', get_template_directory_uri() . '/scripts/audio-player.js', array( 'swfobject' ), null );
    }

    and add some //’s to the relevant lines, so it looks likes this:

    function esplanade_register_scripts() {
    wp_register_script( 'flexslider', get_template_directory_uri() . '/scripts/jquery.flexslider-min.js', array( 'jquery' ), null );
    wp_register_script( 'colorbox', get_template_directory_uri() . '/scripts/colorbox.js', array( 'jquery-migrate' ), null );
    //wp_register_script( 'fitvids', get_template_directory_uri() . '/scripts/fitvids.js', array( 'jquery' ), null );
    //wp_register_script( 'audio-player', get_template_directory_uri() . '/scripts/audio-player.js', array( 'swfobject' ), null );
    }

    #14231
    Jared
    Participant

    Thanks. I added this:

    add_action( ‘wp_print_scripts’, ‘my_deregister_javascript’, 100 );

    function my_deregister_javascript() {
    wp_deregister_script( ‘audio-player’ ); }

    under the custom CSS and that seems to have worked.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.