Update:
I have gone through a GIT (https://wordpress.org/support/topic/problem-with-_transient_enlighter_userthemes-option/) and found that the option was already implemented and it’s under Enlighter -> Options – Dynamic Resource Invocation (DRI) once it was enabled the scripts only load if code blocks are used on a page.
Is there any way to do same with CSS?
-
This reply was modified 6 months ago by
wpkum.
For “real” optimization you should include the selected EnlighterJS themes directly into your minified themes css.
Due to limitations of the internal WordPress content rendering, DRI (in it’s current implementation) cannot work for stylesheets.
The upcoming Enlighter release will include a client-side solution for DRI
@wpkum
please open a new thread…
the method of embedding selected EnlighterJS themes into the “main” WordPress theme is the recommended method for optimization and works flawlessly. if you cannot see any highlighting the styles seems to be missing (check this with the chrome/firefox element inspector)