Wordpress theme for children - function.php copy - cannot "update"

I use Starkers with a child theme (starkers-child).

I need to edit the .php function to declare a menu, so I copied the functions.php folder, JS and the external folder (they were all declared somewhere in the function file)

However, I still have one error:

Cannot redeclare starkers_script_enqueuer() (previously declared in C:\wamp\www\redlaw\wp-content\themes\starkers-child\functions.php:65) in C:\wamp\www\redlaw\wp-content\themes\starkers-master\functions.php 

I believe this is caused by this line:

 function starkers_script_enqueuer() { 

I can understand why, since it already calls the function in master, so it cannot call it again in the child.

But if I delete this line from the wizard, will it not defeat the goal of preserving a clean wizard and having a child theme?

The full functions.php is displayed here (unedited as it appears in the main topic) http://jsfiddle.net/8KGcK/

+1
source share
1 answer

Forgive me, I do not have enough reputation to just comment.

In addition to the parent theme, the functions.php child theme is loaded. Therefore, you do not need to copy and paste the code. What everyone else says about the wrapper in if(function_exists(function)) is optional, but best because it is less error prone.

Anyway!

This is from the Code:

Unlike style.css, function.php of a child theme does not override its copy from the parent. Instead, it loads in addition to the functions.php parents. (In particular, it is loaded immediately before the parent file.)

More here

+1
source

All Articles