我根据网站https://ipipe.ru/info/ustanovka-wordpress-na-openserver安装了wordpress,然后想要使用underscores.me,在那里我输入了underscores.me并按下了generate按钮(结果,一个请求似乎覆盖了wordpress文件)。
致命错误:未定义错误:调用C:\OSPanel\domains\worldelectronics.ru\index.php:15堆栈跟踪中的未定义函数get_header():#0 {main}抛出在第15行的C:\OSPanel\domains\worldelectronics.ru\index.php中
下面是index.php文件
<?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.org/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();如何将取自underscores.me的世界电子产品主题的主页显示出来?
发布于 2020-09-08 18:29:06
您下载的不是WordPress的替代品,而是一个主题。主题需要进入wp-content/themes文件夹中。一旦主题文件夹被正确放置,它应该作为一个选项出现在主题菜单中的WP管理,在那里你可以预览和激活它。
同时,您需要重新安装WordPress,以消除通过用主题覆盖根而造成的损害。您应该在wp-admin、wp-includes或顶层修改文件的唯一时间是在更新到新版本的WordPress时(唯一的例外是wp-config.php )。所有的定制和添加都位于wp-content/themes和wp-content/plugins文件夹中的主题和插件中。
https://wordpress.stackexchange.com/questions/374506
复制相似问题