The functions.php or the theme functions file is a template used by WordPress themes. It acts like a plugin and gets automatically loaded in both admin and front-end pages of a WordPress site. Usually, this file is used to define functions, classes, actions and filters to be used by other templates in the theme. It can be used to add features and extend the functionality of both the theme and the WordPress installation.
The functions.php file can be found in the theme’s folder. You can add both built in WordPress functions and regular PHP functions to hooks and filters that are predefined throughout the WordPress core. Although every theme you have installed on your site has its own functions.php file, only the active theme’s file will run its code. If your theme doesn’t have functions.php file, you can simply create a plain-text file named functions.php and add it to your theme’s directory. Child themes can have their own functions.php files. The functions.php file has WordPress actions and filters, enables post thumbnails, post formats, and navigation menus.