1

Using instructions from the WordPress codex, I have replaced/added to a number of WordPress core and theme functions. For these tasks, code, such as add_action( 'after_setup_theme', 'mytheme_custom_header_setup'); are already putting the code to work in the right place of the processing.

Now, I have a situation where I want to move code from a custom WordPress template in a child theme into functions.php and call it from the template file as needed. In this case, essentially, I want to move code into functions.php that will include a few layers into a highly customized front-page.php after pulling in some custom field data.

Do child theme template files have access to functions.php or do I need to add some code somewhere to make that connection?

1 Answer 1

1

The child theme will have access to the functions in the parent theme's functions.php. Nothing you need to do.

2
  • I want to put the code in the child theme's functions.php file. Does your answer mean that all templates in the child theme will include (have access to) functions in the child theme's functions.php file? Jan 4, 2017 at 23:24
  • 1
    Yes, the child theme will also have access to the functions in the functions.php of the child theme's directory, in addition to the functions in the parent theme's directory. :) Jan 5, 2017 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.