Hi there,
Give this a shot:
add_filter( 'generate_page_hero_output', function( $output, $options ) {
return sprintf(
'<div class="%1$s" data-src="/images/background.jpg">
<div class="%2$s">
%3$s
</div>
</div>',
trim( $options['container_classes'] ),
trim( $options['inner_container_classes'] ),
$options['content']
);
}, 10, 2 );
You’ll of course need to update the path to the background image in the data-src
attribute.
Let me know if you need more info 🙂