Hi there,
that code looks like it specific to the BB theme.
Instead create a new Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
Just add the shortcode part of the code:
echo do_shortcode('[fl_builder_insert_layout slug="gerelateerde-artikelen"]');
Select the before_footer
Hook from the list – you can see where the other main hooks are here:
https://docs.generatepress.com/article/hooks-visual-guide/
Check the Execute PHP and Shortcode boxes.
Then set your display rules for Front Page, Post Archives, Posts