I have a custom page template, and this template need to include one php file. I tried to put this script

require('.../hc-v2-child/ayah.php') and this require(__DIR__.'ayah.php');

in functions.php and in the custom page template, but I'm getting this error

[07-Oct-2015 04:15:21 UTC] PHP Fatal error:  require_once(): Failed opening required '/folder/folder1/public_html/folde3/wp-content/themes/hc-v2-childayah.php' (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear') in /folder/folder1/public_html/folde3/wp-content/themes/hc-v2-child/page-mylogin.php on line 51

If the file you are trying to include is in child theme folder then try following:


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.