What is functions.php ?

As all of WordPress is written in the PHP programming language, the “functions.php” file is a file that controls the functions of a WordPress theme, including actions, filters, and classes.

If you’re only interested in beginning a WordPress site, then you won’t need to understand how the “functions.php” file works as everything will be handled automatically for you by the author of the theme that you are using.

Developers, on the other hand, use “functions.php” to enable features and improve the functionality of a theme. Some themes, however, do not include a “functions.php” file, but it is easy to add an empty text file with that name.

The “functions.php” file operates much like a plugin in that it is automatically loaded by WordPress when a webpage (or the administration screen) is loaded. However, this is only true for the active theme. The “functions.php” files for inactive themes will NOT load until unless the theme has been activated.

Developers should also be aware that child themes can have their own “functions.php” file that either works in conjunction with or replaces the “functions.php” of the parent theme.

Note: If a plugin calls the same function as one defined in your “functions.php” file, huge problems can result, including the disabling of your entire website. Always be extremely careful when modifying your theme’s “functions.php” file!

The following two tabs change content below.

Jamie

My name is Jamie Spencer and I have spent the past 5 years building money making blogs. After growing tired of the 9-5, commuting and never seeing my family I decided that I wanted to make some changes and launched my first blog. Since then I have launched lots of successful niche blogs and after selling my survivalist blog I decided to teach other people how to do the same.