As Tom mentioned on his reply here: https://generatepress.com/forums/topic/single-post-page-2/#post-1518046
Can you transfer how you add the code? You can follow this: https://docs.generatepress.com/article/adding-php/
Note: You can pick between using the Code Snippet plugin or a Child theme to add PHP snippets. Again, Child themes aren’t exactly necessary but is useful in this case.
While some PHP snippets may somewhat “work”, some may cause issues when run from the Hook element. The PHP snippet part of the Hook Element is best used for adding simple HTML (echo or printf) rather than returning filtered things(add_filter()/return).
I should’ve mentioned this earlier, from your other topic too. My bad.
As for addressing the other issues:
1. On the single post page, “by” now shows twice. (I added the “by” on the blog page because it was on the single post page.)
Change this CSS code .author-name:before{content:'by '; color: #b80000;}
to .wp-show-posts-inner .author-name:before{content:'by '; color: #b80000;}
This should remove the extra “by” on the single posts pages.
2. I’d like to reduce the padding between the title and meta on the single post page so it looks like the blog page.
You can remove/reduce the space between the post title and the meta by adding this CSS code:
.entry-meta {
margin-top: 0;
}