2012-10-19 156 views
1

我有archives.php显示帖子的摘录。 (这是我需要http://www.m2advocaten.nl/nieuws(左))WordPress的显示所有帖子的摘录

<!-- Start the Loop. --> 
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> 

<!-- Test if the current post is in category 3. --> 
<!-- If it is, the div box is given the CSS class "post-cat-three". --> 
<!-- Otherwise, the div box is given the CSS class "post". --> 
<?php if (in_category('3')) { ?> 
      <div class="post-cat-three"> 
<?php } else { ?> 
      <div class="post"> 
<?php } ?> 

<!-- Display the Title as a link to the Post's permalink. --> 
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> 

<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. --> 
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small> 

<!-- Display the Post's Content in a div box. --> 
<div class="entry"> 
    <?php the_excerpt(); ?> 
</div> 

<!-- Display a comma separated list of the Post's Categories. --> 
<p class="postmetadata">Posted in <?php the_category(', '); ?></p> 
</div> <!-- closes the first div box --> 

<!-- Stop The Loop (but note the "else:" - see next line). --> 
<?php endwhile; else: ?> 

<!-- The very first "if" tested to see if there were any Posts to --> 
<!-- display. This "else" part tells what do if there weren't any. --> 
<p>Sorry, no posts matched your criteria.</p> 

<!-- REALLY stop The Loop. --> 
<?php endif; ?> 

的问题是,它没有显示的职位,而是网页内容(此代码) 而我只需要一个页面,显示了帖子。 我是否需要添加一个函数?

我也试过帖子的页面,但它没有工作。

回答

相关问题