Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14120 reviews 1680 hosting providers

Questions & Answers

Functions.php in child theme

Feb 27, 2013 by mike231
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 votes
Feb 27, 2013 by WebProX
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 votes
Feb 27, 2013 by expert
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).