From the course: PHP for WordPress

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

The functions file

The functions file

- [Instructor] With the basics of PHP under your belt, let's look at some WordPress-specific features and conventions. The first question answers where to put your custom code. In every theme, there is a file called functions.php. So if we open our code editor and then go to wp-content and themes, we can look in the current active theme, which for me is 2024, and we'll see a functions.php file. This is the simplest way to make changes to your WordPress site because it's the lowest barrier of entry. Every theme has a functions.php file, so you don't need to take additional steps to define the file, like with a plugin, or activate it, also like with a plugin. This will work for classic, that is the pre-block editor themes, as well as block themes. We'll talk more about how PHP affects theme development in another video, but for now, know that the functions.php file is still a crucial part of WordPress theme development. This is great because you can access pretty much every part of…

Contents