Regarding your first query, there are three ways to add your custom code.
Kindly refer to this article to know those ways to add your custom code.
To write a new topic in a forum, you must be logged in – https://cl.ly/598959d8ac73, before you can start a topic. If you click the “Add new topic” link and are not logged in you will be redirected to the login screen before you are taken to the new topic form – https://cl.ly/a7d56905fe10
Regards,
Sweta