Removing Featherlight from Posts Page
-
I found Featherlight including JS and CSS on the posts page and no way to remove it. I couldn’t find a ready answer on Google, so I’m posting this for future searchers.
The “disable” option isn’t available when a page is set as the posts page. Even if “Disable lighbox” is selected before making a page the posts page, Featherlight code is included (WP ver 5.7.1, Featherlight ver 1.3.4).
Here’s my snippet for the functions file to disable lightbox on the posts page.
function disable_featherlight_posts_page() { if ( is_home() ) { add_filter( 'wp_featherlight_load_css', '__return_false' ); add_filter( 'wp_featherlight_load_js', '__return_false' ); } } add_action( 'init', 'disable_featherlight_posts_page' );
If there’s a better way, please post it. Is “init” the right hook for this action?
And thanks for the simple, nicely lightweight plugin.
- The topic ‘Removing Featherlight from Posts Page’ is closed to new replies.