Hi TagDiv,
I purchase your theme a few days ago and I have to say: THANK YOU
I use the default theme without any modification on code and I found some errors on the server and another with w3c validator, hope you can help me.
– on server (VPS): mod_fcgid: stderr: PHP Fatal error: Call to undefined function get_header() in /var/www/vhosts/buscadortransportes.com/httpdocs/wp-content/themes/themename/index.php on line 6
– with wr3c validator link
Regards,
Hello
Please try to refer to these links here -> https://forum.tagdiv.com/topic/call-to-undefined-function-get_header/ and https://forum.tagdiv.com/topic/site-not-reachable/ and follow the steps which have been given there to solve your problem.
Hope this helps!
Thanks for your understanding!
Hi Catalin,
The second link (site not reachable) it has nothing to do with my problem.
With the first one https://forum.tagdiv.com/topic/call-to-undefined-function-get_header/ , ¿ I have to replace the little snippet in your index.php ?
I mean, I have to change the actual?
get_header();
to
if (function_exists('get_header')) {
get_header();
}else{
/* Redirect browser */
header("Location: http://" . $_SERVER['HTTP_HOST'] . "");
/* Make sure that code below does not get executed when we redirect. */
exit;
}; ?>
Hello nairolf2013,
You only need the function from the id statement. This code basicaly creates a redirect from the error to anywhere you want it to redirect. Simply replace get_header from index.php with this part:
if (function_exists('get_header')) {
get_header();
}else{
/* Redirect browser */
header("Location: https://google.com ");
/* Make sure that code below does not get executed when we redirect. */
exit;
};
I set it to redirect to google as an example. You can set it to redirect to your homepage or any other url you want.
I hope this helps.
Thank you!
Hello nairolf2013,
The error was being generated each time that my theme’s index.php file was called directly, and that the error was caused by the theme’s inability to locate the WordPress get_header function (which is completely normal).
Thanks for your message!
Hi Catalin,
I’m having the following issue with the page http://gbhackers.com/wp-content/themes/Newspaper/
Fatal error: Call to undefined function get_header() in /home/gbhabewi/public_html/wp-content/themes/Newspaper/index.php on line 6
Please let me know exactly what to do, I’m not an expert in WordPress so unable to understand.
Hello gbhackersonsecurity,
For more information about this error, please check here -> https://forum.tagdiv.com/topic/fetching-with-google/
Hope this helps!
Thanks for your message!