我的主題支持頁面,帖子和博客類別頁面,但我指定的博客頁面不限制任何內容,它顯示了所有無論如何發佈帖子。 我已經將博客頁面設置爲僅顯示5個最新帖子。我的新WordPress主題完美工作,除了我不知道如何限制博客頁面中顯示的博客文章
我只是想讓它顯示博客文章的摘錄,在底部有一個'Read more ...'鏈接。
如何僅在博客頁面中顯示帖子的摘錄?
當前模板:
<div id="contentMain">
<div class="left-section">
<?php if (have_posts()) while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="body-top"></div>
<div class="entry-content body-content">
<?php
if (is_page()) {
echo '';
}
if ((is_single()) || (is_home())) {
echo '<h2 class="entry-title">'; the_title(); '</h2>';
}
?>
<?php
if (is_page()) {
the_content();
}
if ((is_single()) || (is_home())) {
echo '<h6>'; the_content(); '</h6>';
echo '<hr />';
}
?>
<?php ?>
</div>
<div class="body-bottom"></div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<?php get_footer(); ?>
謝謝,就是這樣。 – 2012-02-09 23:32:29