Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

What is: functions.php

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 your 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 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 filters, you can enable post thumbnails, post formats, and navigation menus.

Additional Reading

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »