admin管理员组文章数量:1323707
I installed wordpress according to the site and then wanted to use underscores.me, where I entered worldelectronics and pressed the generate button (as a result, a request appeared to overwrite the wordpress files).
Fatal error: Uncaught Error: Call to undefined function get_header() in C:\OSPanel\domains\worldelectronics.ru\index.php:15 Stack trace: #0 {main} thrown in C:\OSPanel\domains\worldelectronics.ru\index.php on line 15
Below is the index.php file
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link /
*
* @package WorldElectronics
*/
get_header();
?>
<main id="primary" class="site-main">
<?php
if ( have_posts() ) :
if ( is_home() && ! is_front_page() ) :
?>
<header>
<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
</header>
<?php
endif;
/* Start the Loop */
while ( have_posts() ) :
the_post();
/*
* Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_type() );
endwhile;
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</main><!-- #main -->
<?php
get_sidebar();
get_footer();
How to get the main page of the worldelectronics theme taken from underscores.me to display?
I installed wordpress according to the site https://ipipe.ru/info/ustanovka-wordpress-na-openserver and then wanted to use underscores.me, where I entered worldelectronics and pressed the generate button (as a result, a request appeared to overwrite the wordpress files).
Fatal error: Uncaught Error: Call to undefined function get_header() in C:\OSPanel\domains\worldelectronics.ru\index.php:15 Stack trace: #0 {main} thrown in C:\OSPanel\domains\worldelectronics.ru\index.php on line 15
Below is the index.php file
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress/themes/basics/template-hierarchy/
*
* @package WorldElectronics
*/
get_header();
?>
<main id="primary" class="site-main">
<?php
if ( have_posts() ) :
if ( is_home() && ! is_front_page() ) :
?>
<header>
<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
</header>
<?php
endif;
/* Start the Loop */
while ( have_posts() ) :
the_post();
/*
* Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/
get_template_part( 'template-parts/content', get_post_type() );
endwhile;
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</main><!-- #main -->
<?php
get_sidebar();
get_footer();
How to get the main page of the worldelectronics theme taken from underscores.me to display?
Share Improve this question asked Sep 8, 2020 at 17:51 vladdv861 dvinvladdv861 dvin 1 01 Answer
Reset to default 1What you downloaded was not a replacement for WordPress, it was a theme. Themes need to go inside the wp-content/themes
folder. Once a theme folder is placed correctly it should appear as an option in the theme menu in WP Admin where you can preview and activate it.
In the meantime, you need to reinstall WordPress to undo the damage you caused by overwriting the root with a theme. The only time you should modify files in wp-admin
, wp-includes
or at the top level, are when you're updating to a new version of WordPress ( the only exception is wp-config.php
). All customisation and additions go in themes and plugins located in the wp-content/themes
and wp-content/plugins
folders.
本文标签: templatesUndefined getheader function
版权声明:本文标题:templates - Undefined get_header function 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742130919a2422154.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论