Support » Plugin: SyntaxHighlighter Evolved » Please make defer options for js

  • Resolved Mentik Yusmantara

    (@mentikyusmantara)


    Google page speed is very tricky… it analyse in detail…
    Can you make js transfer via defer.. I just try it manual but not work, defer or async tag is created but make the plugin not working

    // Defer Manual
    add_filter( ‘script_loader_tag’, ‘defer_highligt’, 10, 3 );
    function defer_highligt( $tag, $handle, $src ) {
    if (strpos($src, ‘/syntaxhighlighter/syntaxhighlighter3/scripts/’) !== false) {
    $tag = ‘<script defer=”defer” src=\” . esc_url( $src ) . ‘\’></script>
    ‘;
    }
    return $tag;
    };

    function above succes make all higlight js script defer, but make it not working
    very thanks 🙂

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.