我根据站点https://ipipe.ru/info/ustanovka-wordpress-na-openserver安装了 wordpress ,然后想使用 underscores.me,我在其上输入 worldelectronics 并按下生成按钮(结果,请求似乎覆盖了wordpress文件)。打开创建的站点 worldelectronics.ru 后,浏览器中出现错误消息
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
下面是 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();
告诉我如何实现worldelectronics主题网站主页的输出,取自网站underscores.me。
underscores.me 生成一个简单的 wordpress 主题。这不是wordpress
需要 :
安装 WordPress
将主题复制到 wp-content/themes/
激活她