WordPress – adding a functions.php to child theme

After much sleuthing, I finally figured out how to get a child theme to work with a custom functions.php file.

1.)  copy the section of code from the theme functions.php that you want to use.  For example:

<?php // Opening PHP tag - nothing should be before this, not even whitespace
add_action( 'footer_copyright', 'footer_copyright', 10 );
* function to show the footer info, copyright information
if ( ! function_exists( 'footer_copyright' ) ) :
function footer_copyright() {
$footer_copyright = '<div class="copyright">'.__( 'Copyright &copy; ', 'theme ).'[the-year] [site-link]</div>';
echo do_shortcode( $footer_copyright );

2.) Install the One-Click Child Theme plugin and make a child theme of theme you want to use. Activate the child theme.

3.) Make whatever CSS modifications you want to the child theme, not the original.

4.) FTP your edited functions.php to the child theme directory.



Leave a Reply

Your email address will not be published. Required fields are marked *