What is: functions.php


functions.php or the theme functions file is a template use by WordPress themes. It act like a plugin and gets automatically loaded in both admin and front-end page of a WordPress site. Usually this file is used to define functions, classes, actions and filters to be used by other template 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 your theme’s folder. You can add both built in WordPress functions and regular PHP functions to hooks and filter that are predefined all over the WordPress core. Although every theme you have install 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 a 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 which can be used to either build on top of or entirely replace the one in the parent theme directory. Some of the things you can do with a functions.php file include use WordPress actions and filter, you can enable post thumbnails, post formats, and navigation menus.


Post a Comment

0 Comments