Functions.php in child theme

asked Feb 27, 2013 in Website Builder by mike231 (2,480 points)
Hi all
I was trying to create a child theme for my Twenty Eleven theme and so I copied the file functions.php from my original Twenty Eleven theme to the newly created folder Twenty Eleven Child.  I did this through File management from my cPanel. When I checked my site, I found out that it’s not working and I am getting an error in the function.php file. I copied the file without changing anything. I deleted the file from the child them and my site started working again. How do I copy the functions.php file without causing any problems?
Thanks in advanced

2 Answers

0 like 0 dislike
answered Feb 27, 2013 by WebProX (12,200 points)
The functions.php in a child theme doesn’t override the parent’s file. It loads in addition to the  functions.php file from the parent theme . So you shouldn’t copy the same file. Create a file with an opening PHP tag  and a closing PHP tag,  and you can put your php code within the two tags.
0 like 0 dislike
answered Feb 27, 2013 by expert (14,380 points)
you can copy the file functions.php to the child theme and then on the copy in your child theme delete everything in between the tags <?php and ?>(make sure you are editing the functions.php in your child theme and not the original parent one).