2 回答

TA貢獻1829條經(jīng)驗 獲得超13個贊
實際上從另一個主題復制代碼 -
主要原因 - 頁面未呈現(xiàn)是page.php調用其他主題模板文件來顯示內容。
但是 scratch 主題沒有內容文件夾,也沒有用于渲染內容的額外模板WebPage content-xx.php
//page.php
<?php
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content();?>
<?php endwhile; ?>
</main><!-- #main -->
</div><!-- #primary -->
<!-- <?php get_sidebar(); ?> -->
<?php get_footer(); ?>
最后渲染lorem-imsum頁面

TA貢獻1780條經(jīng)驗 獲得超5個贊
請嘗試以下: HEAD:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php wp_head(); ?>
</head>
<body>
功能:使用您的默認主題功能 twentytwelve 或更新版本
頁面.php
<div>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>
- 2 回答
- 0 關注
- 115 瀏覽
添加回答
舉報