-
AuthorPosts
-
May 1, 2019 at 2:39 am #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. merging the parent theme’s scripts and styles but NOT including the child theme’s scripts and styles
- 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 6 years, 6 months ago by
Michael.
May 1, 2019 at 5:05 pm #1096207Bump.
May 2, 2019 at 10:08 am #1096410Hi,
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ünterMay 2, 2019 at 6:27 pm #1096552Where is the full documentation for this and examples? I want to implement this correctly without a lot of trial and error.
May 3, 2019 at 11:49 am #1096872Hi,
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:
Best regards,
Günter -
AuthorPosts
- You must be logged in to reply to this topic.
