0

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?

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

2 Answers 2

3

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.

2
  • 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
    Commented Dec 24, 2012 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
    Commented Dec 24, 2012 at 15:03
0

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 and acknowledge you have read our privacy policy.

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