Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1183518
    barmenteros
    Participant

    Hi there,

    We’ve added the following code to ‘functions.php’ in order to defer loading of JavaScript and improve our site speed:

    // Defer Javascripts
    // Defer jQuery Parsing using the HTML5 defer property
    if (!(is_admin() )) {
        function defer_parsing_of_js ( $url ) {
            if ( FALSE === strpos( $url, '.js' ) ) return $url;
            return "$url' defer onload='";
        }
        add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
    }

    The above code works fine regarding eliminating render-blocking JavaScript from our site but it also removes ‘Slider Revolution’ from the top of our home page. See the enclosed image to see how our home page looks after adding the code. Right now the site is running without the code so you can check online how it looks normally.

    Find below our info:

    URL: http://barmenteros.com/
    WordPress version: 4.6.1
    X version: 4.6.2 (Running X – Child Theme – Version: 1.0.0)
    Cornerstone plugin version: 1.3.2

    Kindly help us to fix this issue.

    Thanks

    #1183616
    Nico
    Moderator

    Hi There,

    Thanks for writing in.

    I could see your revolution slider upon checking your setup. It shows a video with a text with “we code metatraders solution”.

    Please confirm if it is okay already if not, would you mind sharing us your admin credentials and FTP so we could check your setup closer.

    Don’t forget to set it as private reply.

    Thanks.

    #1183672
    barmenteros
    Participant
    This reply has been marked as private.
    #1184091
    Friech
    Moderator

    Hi There,

    Thanks for the credentials, please edit your slider settings. Under the Problem Handlings panel, troubleshooting tab turn on the Put JS Includes to the Body option.

    Hope it helps, Cheers!

    #1184231
    barmenteros
    Participant

    Thanks but unfortunately it did not work. As you can see in the attached screenshot we turned on the ‘Put JS Includes to the Body’ option and the slider still doesn’t show. Even more we tried enabling ‘JQuery No Conflict Mode’ option with the same result. Any other suggestion? Best

    #1184358
    Christian
    Moderator

    Please test the options available in Slider Revolution’s Global Settings (see attachment). If it still doesn’t work, you will need to seek assistance from a WordPress developer as this might get quite involved. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/

    Thank you for understanding.

    #1189105
    barmenteros
    Participant

    Thanks for your advice although it did not help us to find the solution. We found that the key is not to defer ‘x-head.min.js’ so we added the following code:

    // Defer Javascripts
    // Defer jQuery Parsing using the HTML5 defer property
    if (!(is_admin() )) {
        function defer_parsing_of_js ( $url ) {
            if ( FALSE === strpos( $url, '.js' ) ) return $url;
            if ( strpos( $url, 'jquery.js' ) ) return $url;
            if ( strpos( $url, 'x-head.min.js' ) ) return $url;
            return "$url' defer='defer";
        }
        add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
    }

    Hopefully it will help other users with the same issue. Best

    #1189136
    Thai
    Moderator

    Glad you’ve sorted it out.

    If you need anything else, please let us know 🙂

  • <script> jQuery(function($){ $("#no-reply-1183518 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>