This topic contains 11 replies, has 2 voices, and was last updated by  Sakin 5 years, 5 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #18598

    owen
    Member

    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!

    #18603

    Sakin
    Keymaster

    @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.

    #18605

    owen
    Member

    @Sakin: Would it help if I gave you the functions I wanted to add?

    #18606

    Sakin
    Keymaster

    @owen: Yes sure.

    #18607

    owen
    Member

    @Sakin: ok look here

    #18611

    Sakin
    Keymaster

    @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 like add_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.

    #18624

    owen
    Member

    @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?

    #18627

    Sakin
    Keymaster

    @owen: That Favicon code is file You just add <?php code and remove add_action( 'catchbox_site_generator', 'catchbox_footer_content', 15 ); and rest looks fine.

    #18628

    owen
    Member

    When I do this my site comes up to the white screen of death!

    #18631

    Sakin
    Keymaster

    @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.

    #18634

    owen
    Member

    @Sakin: Thanks for all your help but the code just makes the white screen of death come up!

    #18639

    Sakin
    Keymaster

    @owen: You need to check in detail as that functions work for me.

Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Functions.php won't work in child theme!’ is closed to new replies.