How can I include Wordpress functions in a custom .php file?
In detail: I have a directory under my theme (Constructor) named reports. These contain .php files that generate reports from data from the site with DOMPDF for downloading. For these I would like to use functions that the Wordpress engine provides, for example
get_the_author_meta( 'user_firstname', $user_id )
Fatal error: Call to undefined function get_the_author_meta() in ROOT/public_html/wp-content/themes/constructor/reports/testreport.php on line 15
No webpage was found for the web address: ROOT/wp-content/themes/constructor/reports/testreport.php
You're on the right track. Try this instead: