Tagged: catch box, child theme
- This topic has 11 replies, 2 voices, and was last updated 10 years, 4 months ago by Sakin.
-
AuthorPosts
-
December 24, 2013 at 8:57 pm #18598owenMember
Hi,
I have made a child theme for Catch Box on my site and have added header.php and 404.php inside it and they are working perfectly! However I want to add functions.php inside aswell as I have added a few functions to the file however when I added the file with all the content from the parent theme along with my custom functions but it ended up with a HTTP 500 Internal Server Error so I took a different approach as I had heard online which was to make the functions.php file and enter only the custom functions in it but the functions code just displayed at the top of the page! I’m not sure what else to do. Can someone help?
Thanks in advance!December 24, 2013 at 11:42 pm #18603SakinKeymaster@owen: You can just crate blank functions.php file and then add the function which you want to edit. That functions must have
if ( ! function_exists() )
code in parent theme. Or you have to edit it through hooks and filters.December 24, 2013 at 11:50 pm #18605December 24, 2013 at 11:55 pm #18606December 25, 2013 at 12:17 am #18607December 25, 2013 at 10:19 am #18611SakinKeymaster@owen: You have missed the php opening that is
<?php
add this at the start of your functions.php file. Second you cannot add just action hook without removing it. So, remove this action hook likeadd_action( 'catchbox_site_generator', 'catchbox_footer_content', 15 );
About your Favicon, you don’t need to add code. Just upload favicon from “Appearance => Theme Options => Favicon URL”
Please not, you cannot just add functions.php file and add all code. You need to be careful about that.
December 25, 2013 at 8:25 pm #18624owenMember@Sakin: The favicon code is for the login page as on IE the favicon does not show on the login page for some reason and as for removing the action hook I’m not sure what you mean so could you please show me a finnished example of how the functions.php file should look?
December 26, 2013 at 12:03 am #18627SakinKeymaster@owen: That Favicon code is file You just add
<?php
code and removeadd_action( 'catchbox_site_generator', 'catchbox_footer_content', 15 );
and rest looks fine.December 26, 2013 at 3:32 am #18628owenMemberWhen I do this my site comes up to the white screen of death!
December 26, 2013 at 9:11 am #18631SakinKeymaster@owen: You ca check the code here pastebin.com/DjJ1QMtq . We cannot provide in depth support to functions.php file. This can be totally complicated. We only support CSS and Settings changes.
December 26, 2013 at 5:24 pm #18634owenMember@Sakin: Thanks for all your help but the code just makes the white screen of death come up!
December 26, 2013 at 10:58 pm #18639 -
AuthorPosts
- The topic ‘Functions.php won't work in child theme!’ is closed to new replies.