It’s never a good idea to modify the theme’s function.php file, as the modifications will be erased during updates.
Using the hook element is the best method to add the breadcrumbs:
https://docs.generatepress.com/article/adding-breadcrumbs/#using-hooks-element
In step 2, add your short code like this:
<div class="grid-container grid-parent hide-on-mobile">
yoast short code here
</div>
In step 3, use generate_after_header instead of generate_before_entry_title.
In step 5, select Entire site instead of Post.
Let me know if it works!