Be it a custom theme or a third-party theme, a WordPress theme should only deal with the look and feel of the website.
It shouldn’t deal with the content or functionality of the website by any means.
This is to ensure that no content on your website is lost when you switch themes.
So, make sure your theme doesn’t contain:
If your theme has any of these, move them to a custom plugin.