Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1095994

    I like that enfold attempts to merge scripts and styles to help with performance, but I have a usage case where I don’t want the child theme’s scripts and styles to be included in the merges.

    What’s the best way to go about the following?:

    1. 1. merging the parent theme’s scripts and styles but NOT including the child theme’s scripts and styles
    2. 2. loading the child theme’s scripts and styles after the parent theme has been loaded

    I am not sharing my credentials with you to login to my site, so please don’t ask me for that.

    Thanks.

    • This topic was modified 5 years, 7 months ago by Michael.
    #1096207

    Bump.

    #1096410

    Hi,

    Thank you for using Enfold.

    You can try to use filter avf_exclude_assets and add the scripts/styles you do not want to be merged.

    I would suggest to load the child theme scripts and styles after parent theme.

    Hope this helps you.

    Best regards,
    Günter

    #1096552

    Where is the full documentation for this and examples? I want to implement this correctly without a lot of trial and error.

    #1096872

    Hi,

    There is no documentation for this filter.

    But as you can see here:

    enfold\config-templatebuilder\avia-template-builder\php\asset-manager.class.php line 28:

    
    //files to exclude
    var $exclude_files	= array('css' => array('admin-bar','dashicons'), 'js' => array('jquery-core','admin-bar','comment-reply'));
    

    and line 61:

    
    // files that are always excluded like admin bar files
    // files that are processed are added to this list as well, in case another file should be generated
    
    $this->exclude_files  = apply_filters( 'avf_exclude_assets'  , $this->exclude_files  );
    
    

    And an example how to use the filter:

    https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/Performance/avf_exclude_assets.php

    Best regards,
    Günter

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