• Resolved Moira.Akerman

    (@moiraakerman)


    Hi!

    When I try to move my Functions.php file to my child theme I get this error: Fatal error: Cannot redeclare tc_header_container_start() in /home/aegroupf/public_html/wp-content/themes/customizr/functions.php on line 267
    and the site crashes. What can i do about that?

    Line 267 in the file is this: function tc_header_container_start(){
    Should I add some line of code there?

    Appreciate all help!

Viewing 14 replies - 1 through 14 (of 14 total)
  • What are you trying to do?
    Be more precise please. 🙂
    You put some custom code in the core functions.php (customizr/functions.php) and then you copied the whole file in your child-theme?
    If yes, then it’s wrong.
    Don’t touch the core functions.php, so if you did it, revert it to the original one. Then create a child-theme functions.php this way:

    <?php
    /* Add all your custom functions below*/

    That’s all.

    http://www.themesandco.com/customizr/how-to-customize-customizr-wordpress-theme/
    http://www.themesandco.com/snippet/creating-child-theme-customizr/

    p.s.
    that error means that you cannot declare two functions with the same name, and it’s about php.

    Thread Starter Moira.Akerman

    (@moiraakerman)

    I´m just trying to get the child theme to work properly, so I don´t have to edit the parent theme.
    I made a new functions.php and put all the stuff there and reseted the parent funtions.php. My site just crashes everytime I put that file in the child theme folder..

    Thread Starter Moira.Akerman

    (@moiraakerman)

    I will read through that stuff and maybe learn something.

    What file?

    Thread Starter Moira.Akerman

    (@moiraakerman)

    functions.php with all my custom functions

    Maybe the problem is in your functions.php with all your custom functions.
    Paste it using this a report back the link, and I’ll have a look at it, if you want.

    Thread Starter Moira.Akerman

    (@moiraakerman)

    I will put it..
    Maybe this is a stupid question but should I put everything that is in the original functions.php + my customizations or only my customizations to this new child functions.php? did you understand?

    Yes I think I understand :P.
    It is a legitimate question and the answer is:
    Nope, just the custom functions. I provided links which show you the reasons for that, or at least they should :D. Also I wrote :

    Then create a child-theme functions.php this way:

    <?php
    /* Add all your custom functions below*/
    
    That's all.

    “custom” is the key word 😀

    Thread Starter Moira.Akerman

    (@moiraakerman)

    yup, all my experiences with php is related to crashing so have to make sure 🙂 I tried that too (only but the custom codes) but guess what happened..

    You don’t need to copy the function.php file into your child theme. WordPress looks at the function.php in your child and in your parent theme.

    You just need to add new or overwrite functions in the child theme . You need to have a function.php file in both child and parent. If you no longer have a function.php file in your parent theme that is a problem.

    Moira I told you, what kind of error do you get?

    Thread Starter Moira.Akerman

    (@moiraakerman)

    It´s finally working! 🙂 I think I had the same code snippets in both parent and child and that´s the reason it didn´t work. Or, it could be just magic 🙂

    Thread Starter Moira.Akerman

    (@moiraakerman)

    so it´s resolved! thank you again!

    😉

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

The topic ‘Error code’ is closed to new replies.