Added a new template file to a theme – get Call to undefined function error

I added a new file in the theme folder and it doesn’t seem to be working properly.

The first line get_header(); creates an error Fatal error: Call to undefined function get_header() like it’s not seeing any includes.

Any ideas why that happens? All files in the same theme folder work just fine except this one.

1 Answer
1

You are prbebaly using wordpress elements outside the loop
and since its a file ou dont access directly from wordpress
structure but a file you created yourself you should include

<?php
require_once("../../../wp-load.php");
?>

Above the doc type opening tag in sendEMail.php file..

Leave a Comment