Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1471718

    Hello,

    we use Enfold Theme with Hummingbird catching plugin.
    We had expierenced some braking of style on our mobile phone website.
    Hummingbird support now came up with a solution as follows:

    By default your theme will create one new style file for each post and page you have, this approach is fine but can cause some issues in caching plugins when we try to optimize the files.

    We added this script for your website:

    add_action( ‘plugins_loaded’, function() {
    if ( ! defined( ‘WPHB_VERSION’ ) ) {
    return; // Hummingbird is not installed/enabled.
    }
    add_filter( ‘wphb_dont_add_handle_to_collection’, function( $value, $handle, $src, $type ) {
    if ( 0 === strpos( $handle, ‘avia’) ) {
    $value = true;
    }
    return $value;
    },10, 4 );
    });

    This will skip combining those files as they are small and already compressed.

    #1471723

    Hey Stefan,

    Thanks for sharing that. If you would like to remove that theme functionality, then please add this to your child theme functions.php file:

    /**
     * Filter to skip css file generation.
     * You can add logic to skip for certain pages/posts only.
     * 
     * @since 4.8.6.1
     * @param boolean $create
     * @return boolean					true | false or anything else to skip generation of css file
     */
    function custom_avf_post_css_create_file( $create )
    {
    	return false;
    }
    
    add_filter( 'avf_post_css_create_file', 'custom_avf_post_css_create_file', 10, 1 );

    Best regards,
    Rikard

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