WordPress – How to setup one child functions.php for multiple themes

If you have multiple child themes and you want to have a common functions.php between all of them, there is a simple way to do that.

create the following file /wp-content/themes/common-funcs.php, and paste what you need in it.

In the child theme functions.php use:
[php]
//use TEMPLATEPATH with is the path of the child template.
require_once ( TEMPLATEPATH . ‘/../common-funcs.php’ );
//or use WP_CONTENT_DIR which translated to the wp-content directory
require_once ( WP_CONTENT_DIR . ‘/themes/common-funcs.php’ );
[/php]

Published on: 31 May 2013
Posted by: Sami K.