Title: disabling via functions.php
Last modified: August 30, 2016

---

# disabling via functions.php

 *  Resolved [roeeyossef](https://wordpress.org/support/users/roeeyossef/)
 * (@roeeyossef)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/disabling-via-functionsphp/)
 * Hi,
 * How can i disable the loading of css / js of the plugin ? is there a filter for
   that ?
 * [https://wordpress.org/plugins/wp-featherlight/](https://wordpress.org/plugins/wp-featherlight/)

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

 *  [SiteCare](https://wordpress.org/support/users/wpsitecare/)
 * (@wpsitecare)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/disabling-via-functionsphp/#post-6477108)
 * Hi Roeeyosse,
 * You can disable the javascript using this filter: [https://github.com/wpsitecare/wp-featherlight/blob/develop/includes/class-scripts.php#L111-L117](https://github.com/wpsitecare/wp-featherlight/blob/develop/includes/class-scripts.php#L111-L117)
 * And you can disable the CSS using this filter [https://github.com/wpsitecare/wp-featherlight/blob/develop/includes/class-scripts.php#L64-L76](https://github.com/wpsitecare/wp-featherlight/blob/develop/includes/class-scripts.php#L64-L76)
 * Thanks for using the plugin, and let us know if we can help with anything else!
 *  Thread Starter [roeeyossef](https://wordpress.org/support/users/roeeyossef/)
 * (@roeeyossef)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/disabling-via-functionsphp/#post-6477110)
 * Thanks alot,
 * it’s a great plugin, can you tell me exactly what are the exact lines i need 
   to add to functions.php ? it seems that i’m not really an expert on how to use
   filters in WordPress…
 *  Thread Starter [roeeyossef](https://wordpress.org/support/users/roeeyossef/)
 * (@roeeyossef)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/disabling-via-functionsphp/#post-6477112)
 * i tried adding :
 *     ```
       /* filter featherlight plugin js & css from homepage */
       function remove_featherlight_js_css_home() {
       	if( is_home() ) {
       	add_filter( 'wp_featherlight_load_css', false );
       	add_filter( 'wp_featherlight_load_js', false );
       	}
       }
   
       add_action('wp', 'remove_featherlight_js_css_home');
       ```
   
 * but i get Warning: call_user_func_array() expects parameter 1 to be a valid callback,
 * what am i doing wrong ?
 *  [SiteCare](https://wordpress.org/support/users/wpsitecare/)
 * (@wpsitecare)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/disabling-via-functionsphp/#post-6477214)
 * It’s hard to say without seeing a lot more information about your site, but one
   of the function names is incorrect, and it looks like you may be trying to add
   the filter too late.
 * Something like this should do the trick: [https://gist.github.com/ryandonsullivan/6e599f01a2879ff7f5ef](https://gist.github.com/ryandonsullivan/6e599f01a2879ff7f5ef)
 * If it doesn’t, you may need to adjust the priority, or where things are hooking
   in. The correct answer will likely depend on a number of other factors like your
   theme code and how other plugins on your site handle various things.
 * I’d recommend reading through the plugin API documentation to help you get your
   desired results [https://codex.wordpress.org/Plugin_API](https://codex.wordpress.org/Plugin_API)
 * Good luck!

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

The topic ‘disabling via functions.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-featherlight_121e24.svg)
 * [WP Featherlight - A Simple jQuery Lightbox](https://wordpress.org/plugins/wp-featherlight/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-featherlight/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-featherlight/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-featherlight/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-featherlight/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [loading](https://wordpress.org/support/topic-tag/loading/)

 * 4 replies
 * 2 participants
 * Last reply from: [SiteCare](https://wordpress.org/support/users/wpsitecare/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/disabling-via-functionsphp/#post-6477214)
 * Status: resolved