[Support request] Removing The Internet Explorer conditional comment

Home Forums Support Removing The Internet Explorer conditional comment

  • This topic has 3 replies, 2 voices, and was last updated 5 months ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1254880
    Patrick

    Hi,
    could you please advise how to remove the Internet Explorer conditional comment from the HTML…

    <!--[if lte IE 11]> <script type='text/javascript' src='https://MYWEBSITE.com/wp-content/themes/generatepress/js/classList.min.js?ver=2.4.2'></script> <![endif]-->

    I’m building a site using a child theme of GeneratePress and would like to remove the reference to the parent theme. Although, I believe that this may affect upgrading Generatepress, its no problem for this project.
    Thanks,
    Patrick

    #1255258
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Are you wanting to remove the conditional or the entire classList.min.js file?

    #1255311
    Patrick

    Just the conditional please.
    Thanks

    #1255738
    Tom
    Lead Developer
    Lead Developer

    Hmm, we use the core wp_script_add_data() function to add the condition, but they don’t have a way to remove it.

    The only way is somewhat hacky, and might not be super update-proof if we ever change the file/handle.

    add_action( 'wp_enqueue_scripts', function() {
        wp_dequeue_script( 'generate-classlist' );
        wp_enqueue_script( 'custom-generate-classlist', get_template_directory_uri() . "/js/classList{$suffix}.js", array(), GENERATE_VERSION, true );
    }, 100 );
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.