为什么我的页面中的内容无法显示?

问题描述 投票:1回答:1

我编辑了一个新页面,这里是内容。

enter image description here

发布并查看它。

enter image description here

为什么没有显示? 主题是“二十四”。

sudo cat /var/www/html/wp/wp-content/themes/twentyfourteen-child/page.php

<?php /* Template Name: Custom Front Page */ ?>

<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that
* other ‘pages’ on your WordPress site will use a different template.
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/

get_header(); ?>
<div id=”main-content” class=”main-content”>
<div id=”primary” class=”content-area”>
<div id=”content” class=”site-content” role=”main”>
<p>it is a test</p>

</div><!– #content –>
</div><!– #primary –>
<?php get_sidebar( ‘content’ ); ?>
</div><!– #main-content –>
<?php

为什么所有的双引号而不是",单引号是而不是'

  1. 如何显示我的页面?
  2. 引号是否格式正确?
wordpress
1个回答
1
投票
  1. 您不打印网站上的内容。最好的方法是使用WordPress循环。所以代码应该是这样的:
<?php </* Template Name: Custom Front Page */ ?>

<?php get_header(); ?>
  <div id="main-content" class="main-content">
    <div id=”primary” class=”content-area”>
      <div id="content" class="site-content" role="main">
        <?php if(have_posts): while(have_posts): the_post(); ?>
           <h1><?php the_title(); ?>
           <?php the_content(); ?>
        <?php endwhile; endif; ?>
      </div>
    </div>
    <?php get_sidebar( 'content' ); ?>
</div>
<?php get_footer(); ?>
  1. 不,它应该是"'
© www.soinside.com 2019 - 2024. All rights reserved.