Home › Forums › WoodMart support forum › PHP Fatal error in root of /wp-content/themes/index.php:11
PHP Fatal error in root of /wp-content/themes/index.php:11
- This topic has 5 replies, 2 voices, and was last updated 1 year ago by
Artem Temos.
-
AuthorPosts
-
February 7, 2024 at 12:36 pm #537575
av_admin_1984ParticipantHello
Everye week I got this error
[03-Feb-2024 20:34:33 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_header() in /home/site/public_html/wp-content/themes/index.php:11 Stack trace: #0 {main} thrown in /home/site/public_html/wp-content/themes/index.php on line 11
and in my root of /public_html/wp-content/themes/ there is an index.php file and inside that file is :
<?php /** * The main template file */ if( function_exists( 'woodmart_is_woo_ajax' ) && woodmart_is_woo_ajax() ) { do_action( 'woodmart_main_loop' ); die(); } get_header(); ?> <?php // Get content width and sidebar position $content_class = woodmart_get_content_class(); ?> <div class="site-content <?php echo esc_attr( $content_class ); ?>" role="main"> <?php do_action( 'woodmart_main_loop' ); ?> </div><!-- .site-content --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Where is coming?
Should I remove this file?This is line 11
get_header(); ?>
-
This topic was modified 1 year ago by
av_admin_1984.
February 7, 2024 at 1:14 pm #537603
Artem TemosKeymasterHello,
This function is a core WordPress function and your error says that it is missing which is impossible. Most likely, somebody tried to open this file in the browser.
Kind Regards
February 7, 2024 at 1:51 pm #537630
av_admin_1984Participant1- Is it safe to remove that index.php?
2-Most likely, somebody tried to open this file in the browser.
How? Could you please give me the path of this file for the browser?
3-in index.php file I see this code:if( function_exists( 'woodmart_is_woo_ajax' ) && woodmart_is_woo_ajax() ) { do_action( 'woodmart_main_loop' ); die(); } get_header(); ?> <?php // Get content width and sidebar position $content_class = woodmart_get_content_class(); ?> <div class="site-content <?php echo esc_attr( $content_class ); ?>" role="main"> <?php do_action( 'woodmart_main_loop' ); ?> </div><!-- .site-content --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Those codes mentioned to woodmart, it that right?
February 7, 2024 at 3:27 pm #537674
Artem TemosKeymaster1. 3. Our theme doesn’t create that file. Most likely you copied it there accidentally.
2. We don’t know how since this error appears on your website only.
Kind Regards
February 7, 2024 at 5:17 pm #537731
av_admin_1984ParticipantFine,
I removed that file,
Please close this topic
Thanks
February 7, 2024 at 5:18 pm #537735
Artem TemosKeymasterYou are welcome. Feel free to contact us if you have any further questions.
-
This topic was modified 1 year ago by
-
AuthorPosts
- You must be logged in to create new topics. Login / Register