I am developing a child theme based on storefront as parent theme. I am trying to include files in child theme functions.php file as:

require_once get_stylesheet_directory() . '/inc/_customizer.php';
require_once get_stylesheet_directory() . '/inc/_header.php';

When I move any function from functions.php file to _header.php or _cuztomizer.php files which are in the inc folder in the child theme it does't works but either in functions.php file it works very well. I don't know what I am doing wrong and how I can include files in function.php file.

Please help me. Thank you in advance

1 Answer 1


The answers to this question state that require_once operates at a file-system level. I would try

include get_stylesheet_directory() . '/inc/_customizer.php';

try to change require_once with include and see if that works. If it does, you can research how to use require_once correctly at your leisure.

  • Thanks bro.it works as include get_stylesheet_directory() . '/inc/_header.php';
    – Syed Aqeel
    Mar 30, 2017 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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