Title: Fatal error: Cannot redeclare leaf_setup()
Last modified: August 21, 2016

---

# Fatal error: Cannot redeclare leaf_setup()

 *  Resolved [iambob](https://wordpress.org/support/users/iambob/)
 * (@iambob)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-leaf_setup/)
 * Greetings,
 * I worked on some changes to my child theme on my sandbox site, which involved
   making a change to theme-functions.php (repercussion understood) … this worked
   fine. When I uploaded this file to my live site it produced this error message:
 * “Fatal error: Cannot redeclare leaf_setup() (previously declared in ..leaf/includes/
   theme-functions.php:33) in includes/theme-functions.php on line 66”
 * Q1: What’s this about?
 * Q2: Is it good practice to activate/return to Leaf _before_ making child changes,
   then re-activate the child?
 * Appreciate any feedback/solution ideas … so far not finding anything that helps(
   site currently running without the font change).
    Bob

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [iambob](https://wordpress.org/support/users/iambob/)
 * (@iambob)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-leaf_setup/#post-4506111)
 * Hold on! That was last night. This request can be disregarded. Some more notes
   below for anyone interested to read further observations (&/or ponderings of 
   a hack-coder!):
 * Work also involved changes to functions.php, template-functions.php and template-
   tags.php, all of which I removed just to get back to a viewable web site.
 * Just after this post, I kept in place the original leaf/functions.php and only
   replaced template-functions.php and template-tags.php … and now the site looks
   exactly how I want it to! (????)
 * I think I was following some inaccurate information about (un)necessary changes(
   an add_filter) to functions.php, and this triggered the error (i.e., confused
   instructions: double?).
 * Curious tho, that functions.php in my child folder requires the removal (via 
   renaming) of functions.php in ../leaf root (unlike footer.php and home.php: original
   files in place with customized files in child root – provide results as expected).
 * So, all is well … other than the ongoing subtle pressure to find time to learn
   how to code properly!
 * Enjoy your day,
    Bob
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-leaf_setup/#post-4506114)
 * > Curious tho, that functions.php in my child folder requires the removal (via
   > renaming) of functions.php in ../leaf root
 * It doesn’t. In fact, you should _never_ delete or edit any files in the parent
   theme. Sounds like you needed to create a new, custom, function in your child
   theme instead of trying to re-use one that was pre-defined in the parent theme.
 *  Thread Starter [iambob](https://wordpress.org/support/users/iambob/)
 * (@iambob)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-leaf_setup/#post-4506265)
 * Thanks esmi … indeed! Noted and added to the someday (or, if-I-ever-make-money-
   from-my-plans developer’s) ‘to do’ list!
 * Cheers

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal error: Cannot redeclare leaf_setup()’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/leaf/1.1.2/screenshot.png)
 * Leaf
 * [Support Threads](https://wordpress.org/support/theme/leaf/)
 * [Active Topics](https://wordpress.org/support/theme/leaf/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/leaf/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/leaf/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [theme-functions.php](https://wordpress.org/support/topic-tag/theme-functions-php/)

 * 3 replies
 * 2 participants
 * Last reply from: [iambob](https://wordpress.org/support/users/iambob/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-cannot-redeclare-leaf_setup/#post-4506265)
 * Status: resolved