Functions.php
Quick Definition
functions.php is a theme file that acts like a built-in plugin. It lets you add custom features, register menus and widget areas, enqueue scripts, and hook into WordPress — all specific to your active theme.
What Is Functions.php?
According to the WordPress Theme Handbook, functions.php is a theme file that "can be used to hook into the core functions of WordPress to make your theme more modular, extensible, and functional." It behaves like a plugin, but is tied to your active theme.
Key facts:
- Theme-specific — only runs when its theme is active
- Loading order — plugins first, then child theme, then parent theme
- No header required — unlike plugins
- Location:
wp-content/themes/your-theme/functions.php
Functions.php in Practice
Common uses: register menus, add widget areas, enable theme features, enqueue CSS/JS, add custom hooks, create shortcodes.
vs. a plugin: Theme-specific features go in functions.php. Theme-independent features go in a plugin or code snippet plugin.
A syntax error breaks your entire site. Always keep SFTP access ready.
Why It Matters
functions.php is where your theme comes to life. See our code snippet plugins guide and best themes guide.