• Resolved belbe

    (@belbe)


    Hi there,
    I need to activate ‘Combine JavaScript Files’ however when I do so most of the content of my home page disappears, most images, tables, plus more. Headers and footers, sliders, and some other things remain. Can you assist? Thanks

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @belbe,

    You can use the Exclude from JavaScript Combination functionality to exclude any scripts that are not functioning properly after the optimization is enabled.

    If you have any issues after that, feel free to reach back to us.

    Kind regards,
    Stoyan

    Thread Starter belbe

    (@belbe)

    Hi Stoyan,
    Thanks for that, I have attempted to action this advice and have experimented with excluding all the scripts that appear in the drop down menu, and also with excluding certain combinations of scripts. I have been successful in getting most of the content to reappear however there are three items which I cannot get to function with JavaScript Combination option enabled – all images (except background images & vid thumbs), Gravity Forms plug in and mobile drop down menu under ‘client portal’. Do you have any advice on that? I believe some of the scripts I need to exlude are not appearing in the drop down menu, however I don’t know how to exclude those manually. I have currently left the site without JavaScript Combination enabled at all. Thanks again, Belbe

    Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @belbe,

    If a script is not present in the dropdown menu, you can exclude the script from being combined using the filter we’ve designed for that purpose. Here’s an example of the code.

    
    add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
    function js_combine_exclude( $exclude_list ) {
        $exclude_list[] = 'script-handle';
        $exclude_list[] = 'script-handle-2';
    
        return $exclude_list;
    }

    Most of the time, the reason for a script not being present in the exclude dropdown is because it was not enqueued properly. In those cases you can use the filters we have provided for that purpose.

    Kind regards,
    Stoyan

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Combine JavaScript Files’ is closed to new replies.