Include custom php file in functions.php of child theme

Hello,

I was previously using this code in child theme’s functions.php to include my custom.php file:

require_once(dirname(FILE) . ‘/custom.php’);

However, it isn’t working. I also tried this:

require_once( get_stylesheet_directory(). ‘/custom.php’);

But this isn’t working as well. The custom.php file resides in the child theme directory. Please assist as to how to include this file.

TIA!

I was able to solve the problem. TIA!

Hey @powerlogo,

We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.