Conditional loading of JS and CSS
-
Hi Ronald,
sorry to bug you again, but for better or worse I’m also a performance freak and passionate minimalist.
So I was wondering: Do you see a possibility to not load the JS and now the CSS of the plugin on pages which do not allow comments? I don’t know if there is an easy way to ask WP about this, but you are definitely fitter than me, perhaps you know something. This would make especially the landing page a teeny bit lighter, which is always good for Google and Co. I know they’re not big, but still, every little bit helps.
Alternatively an option box when editing the page. WP Featherlight (a great lightbox plugin for performance freaks) does this, albeit a little bit wonky). A checkbox is added to the ‘Publish’ dialog called ‘Disable lightbox’, and prevents the loading on that page when checked – you could lift the code from WP Featherlight. But obviously automatic detection would be better.
If this is too much hassle, accept my apologies and just ignore.
Thanks,
Tim
The topic ‘Conditional loading of JS and CSS’ is closed to new replies.