我有下面的代码front-page.php
(在设置>阅读中设置该页面);然而,有些地方出了问题,因为帖子没有显示出来。输出如下所示。有人能确定问题是什么吗?
<?php get_header();?>
<section id="home-content">
<section id="latest-news">
<h2>Latest News</h2>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article class="entry" id="post-<?php the_ID(); ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
<section class="description">
<h3><?php the_title(); ?></h3>
<time datetime="<?php the_time(\'c\'); ?>"><?php the_time(\'F d, Y\'); ?></time>
<?php the_content(); ?>
<p class="post-categories">Categorized under: <?php the_category(\', \'); ?></p>
<a class="read-more" href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title_attribute(); ?>"></a>
</section>
</article>
<?php endwhile; ?>
<?php my_paginate_links(); ?>
<?php endif; ?>
</section>
</section>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
上面的代码输出下面的html。注意:“主页”是一个页面,不是帖子。
<article class="entry" id="post-1048">
<section class="description">
<h3>Home</h3>
<time datetime="2012-08-29T06:38:44+00:00">August 29, 2012</time>
<p class="post-categories">Categorized under: </p>
<a class="read-more" href="http://site.com/" rel="bookmark" title="Read Home"></a>
</section>
</article>