Tristan .L Tristan .L - 4 months ago 7x
PHP Question

Wordpress childtheme functions.php management

So for most Wordpress users this may sound familiar.

You make an active child-theme and a functions.php. After a while this php file will be filled with many action/filter hooks. Some for Wordpress itself, others for plugins. This makes it (to me) a hot mess. It's hard to keep an overview what's going on without making big blocks of comments.

How can one best approach this? I was considering turning the php into plugins or make separate php files which are included with the functions.php.

What would be the best practice and give the best performance?


make an inc directory within your WordPress child theme's root and add categorized function files within that. Then include them in your functions.php file:

- js
- css
- inc
- ...