Like custom CSS and JS, you can add custom PHP codes using the code snippets plugin. It is handy for changing the functions of your site.