Conditional loading of JS and CSS
-
Hi Ronald,
this is what I wrote on this topic 5 years ago:
—
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.
—
I don’t see such an option yet… although you replied that you would put it on your radar.
But now I have a simpler idea: A global option to load only on posts but not pages. That would work fine for me in a new project I’m just tying up.
Thanks for a great plugin! Tim
You must be logged in to reply to this topic.