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

    Some advice below for setting up WP-Rocket with Enfold.

    Wp-Rocket’s lazy load feature also applied to background images but only if the tags are in the html. The new Post CSS generator for Enfold stops background images from lazy loading because it stores the background URLs in the CSS file instead of the HTML. You can make them lazy load by doing the following:

    You can turn off post CSS file generation with the following code in your functions.php file.

    // stop postcss generating
    add_filter('avf_post_css_create_file', '__return_false', 1, 1);

    This is also advised for CDN usage. A CDN cannot serve the background image from CDN if it isnt in the html file unless the specific CDN you use re-processes your CSS files to change the URL of the background image.

    #1398918

    Hey Thomas,

    Thanks for sharing your experience, it’s much appreciated :-)

    Best regards,
    Rikard

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