这是因为您列出的代码只包含标题和链接的引用。这是您的原始代码,带注释。。。
原件
<?php $debut = 0; //The first article to be displayed ?>
<?php while(have_posts()) : the_post(); ?>
<!-- Display the title of the current page that\'s listing your posts -->
<h2><?php the_title(); ?></h2>
<!-- Create an unordered list to display a list of posts -->
<ul>
<!-- Get a list of all posts, not including the first post -->
<?php $myposts = get_posts(\'numberposts=-1&offset=$debut\');
// Loop through each post that your just grabbed
foreach($myposts as $post) : ?>
<!-- Add a list element for the post -->
<li><?php the_time(\'d/m/y\') ?>: <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<?php endwhile; ?>
这将创建一个如下所示的块:
<ul>
<li>5/2/2012: <a href="">Post title</a></li>
<li>5/2/2012: <a href="">Post title</a></li>
</ul>
你应该做什么你只需要更新你的帖子模板。现在,它正在抓取帖子并输出发布日期、链接和标题。因此,请更换
<ul> ... </ul>
使用此选项:
<div class="post-list">
<?php $myposts = get_posts( \'numberposts=-1&offset=$debut\' );
foreach( $myposts as $post) : setup_postdata( $post ) ?>
<h1><?php the_title(); ?></h1>
<!-- Only display part of the post so the user has to click "More!" -->
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">More!</a>
<?php endforeach; ?>
</div>