Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1218175
    fatheaddrummer
    Participant

    Hi There,

    I am currently trying to defer js but when I do this, my onepage navbar is no more sticky.
    Could you tell me which js I have to exclude from deferring in order to keep this one working?

    It would be awesome if you could help me out with this!! 🙂

    Thanks in advance for the great support!
    Related URL: http://www.diamond-precision-studio.com/de/mixing-online-de/

    Best, Christian

    #1218201
    Thai
    Moderator

    Hi There,

    Please add the following code under functions.php file locates in your child theme:

    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 );
    }

    Hope it helps 🙂

    #1218257
    fatheaddrummer
    Participant

    Thank you very very much!! I already found the file! 🙂

    Could you maybe also tell me which js I have to exclude for the lightbox to show up correctly?

    Thank you so much!!

    Best, Christian

    #1218274
    Thai
    Moderator

    Here you are: vendor-ilightbox.min.js

    Let us know how it goes!

    #1218292
    fatheaddrummer
    Participant

    Hello Thai,

    Thank you very much! That sounds like, what I’ve been searching for!
    I tried to exclude it “autoptimize”, but unfortunately for now the lightbox just opens ups as fullscreen…

    Could you tell me where the file is located? I think I need to give a path to autoptimize..

    Thank you very much!
    Best, Christian

    #1218327
    Thai
    Moderator

    Hi Christian,

    The full path is: wp-content/plugins/cornerstone/assets/dist/js/site/vendor-ilightbox.min.js

    Hope it helps 🙂

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