Forum Replies Created
-
AuthorPosts
-
croosenMember
Hi there,
I was wondering the same. As my clients have full access to their websites, they might want to update the child theme (by accident or not) and then all my custom mods in functions.php are gone.
I have found that I can include a custom functions.php in the child themes' functions.php this way:
- in your child themes' folder create a file called "custom-functions.php". This can be an empty file at first, where you can put your custom code.
- open your child themes' functions.php and include this file right at the top after the"require_once" like this:
//* Start the engine require_once( get_template_directory() . '/lib/init.php' ); include_once( 'custom-functions.php' );
Now in your custom-functions.php you can add your custom functions code, I tried to insert a piece of code to simply change the footer credits (see more snippets to try here http://gregrickaby.com/genesis-code-snippets/), and this worked.
This way I think, if the theme gets an update, the "custom-functions.php" might stay intact and you can easily include the files again.
BUT THIS IS NOT TESTED AFTER AN UPDATE. I did not test if an update replaces the whole child-theme folder and lets the custom files stay or not. You might want to try to include from a different dir to be safe, if someone has an example of that please let me know.
-
AuthorPosts