• Hello, I’m getting a lot of these errors across several of my sites:
    2017-11-02_03:08:40_PHP Fatal error: Call to undefined function get_header() in /srv/data/web/vhosts/MYSITE.COM/htdocs/wp-content/themes/twentyseventeen/404.php on line 13

    Thanks…

Viewing 16 replies (of 16 total)
  • Moderator bcworkz

    (@bcworkz)

    You could do to your theme template files like several core admin files do at the very beginning of the file, placing code like this:

    // don't load directly
    if ( !defined('ABSPATH') )
    	die('Cheatin’ uh?');

    This will prevent subsequent PHP errors when the file is requested directly. The constant ABSPATH is defined in wp-config.php, which is called for every valid WP request. Not being defined is a sure sign that there was an attempt to bypass loading WP, be it on purpose or by accident. It’ll take a lot less than 3 day, even if you’re not a developer. To be sure, it’s only a stop gap measure, and copying template files to a child theme just for this purpose is questionable.

Viewing 16 replies (of 16 total)
  • The topic ‘Call to undefined function get_header() in 404.php’ is closed to new replies.