How to load parent_theme functions.php before child_theme?

Posted by Rohit Kumar | Updated on

If you want to load parent_theme functions.php before child_theme? You are on the right track with the after_setup_theme() hook.

As far as I remember the trick is to wrap your filters and actions into it’s function.

See the below example:

You do that in both parent and child functions.php files. Then you can play with the priority of these two hooks. Little bit of code worth thousand words – your parent theme’s function.php should look like this:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers