Support » Plugin: Enlighter - Customizable Syntax Highlighter » Add Enlighter Scripts and Styles only on Required Posts

  • Resolved wpkum

    (@wpkum)


    Hi!

    Enlighter is adding Scripts and Styles on every page. Is there any way to add the JS/CSS only on Enlighter required/used pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • wpkum

    (@wpkum)

    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.
    Plugin Author Andi Dittrich

    (@andi-dittrich)

    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

    (@wpkum)

    Hi, I have tried adding the generated CSS by Enlighter into the WordPress theme. and disabled the EnlighterJS themes option to prevent loading the Enlighter themes CSS.

    It doesn’t work it was displaying a plain text code

    It would be great if you work on this feature.

    Best wishes,

    • This reply was modified 6 months ago by wpkum.
    • This reply was modified 6 months ago by wpkum.
    • This reply was modified 6 months ago by wpkum.
    • This reply was modified 6 months ago by wpkum.
    • This reply was modified 6 months ago by wpkum.
    • This reply was modified 6 months ago by wpkum.
    • This reply was modified 6 months ago by wpkum.
    Plugin Author Andi Dittrich

    (@andi-dittrich)

    @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)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add Enlighter Scripts and Styles only on Required Posts’ is closed to new replies.