• Resolved iambob

    (@iambob)


    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

    (@iambob)

    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

    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

    (@iambob)

    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.