Hi Roeeyosse,
You can disable the javascript using this filter: 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
Thanks for using the plugin, and let us know if we can help with anything else!
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…
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 ?
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
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.ww.wp.xz.cn/Plugin_API
Good luck!