If your theme gets updated once in a while, you don’t want to alter theme files because your changes will be overwritten during the update. Instead, create a child theme or custom plugin to contain your code. You can add your code to the child’s functions.php, or keep it on a separate file which is included into functions.php.
Similar for plugins, you can place code in the main plugin file or include a separate page. For more information on child themes, plugins, and WP development in general, start at https://developer.www.ads-software.com/
]]>