I am working on a child theme and I want to disable a JavaScript file from the parent folder instead of deleting it.

I have a functions.php file in my child theme folder but don't know how to do it.

In my parent folder I have this file in my js folder: jquery.tipsy.js and I want to ignore it in my child theme. What is the best way to do this?

  • Can you post the contents of your functions.php file so we can take a look at it? s_ha_dum is correct. – gteh Dec 23 '12 at 18:34

If the script is registered and enqueued correctly you might be able to deregister it, but you have posted nowhere enough information for me to really say how.

Parent themes load after the child so that is another potential issue, depending on how the theme is written.

  • Thank you all.this is the line i dont want: if(!is_admin()){ wp_register_script( 'Tipsy', WP_THEME_URL . '/assets/javascripts/jquery.tipsy.js', false, null, true); wp_enqueue_script( 'Tipsy' ); global $user_ID; if( $user_ID ) : if( current_user_can('level_10') ) : wp_deregister_script( 'Tipsy' ); endif; endif; wp_register_script( 'SkeletonKey', WP_THEME_URL . '/assets/javascripts/skeleton-key.js', false, null, true); wp_enqueue_script( 'SkeletonKey' ); } – Daniel Dec 24 '12 at 6:52
  • Edit you answer to include the code, please. Code formatting in comments is nearly non-existent, making long chunk unreadable. – s_ha_dum Dec 24 '12 at 15:03

Have you tried commenting those lines out?

//function this script () blahblah .js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.