[英]In my Wordpress theme, how can I add pagination for the blog page?
我目前已將Wordpress設置為僅在博客頁面中顯示最新的5條帖子。 它可以正常工作,並且根據需要顯示了摘要。
唯一的問題是,第6個帖子完全沒有顯示,也沒有添加分頁。 我需要一個“上一個/下一個”系統來顯示其他頁面,但找不到在任何地方實現它的方法。
當前主題代碼:
<?php
if (is_page()) {
the_content();
}
if (is_front_page()) {
the_content();
}
if ((is_single())) {
echo '<h2 class="entry-title"><a href="'; echo the_permalink(); echo'" title="'; the_title(); echo '">'; the_title();
echo '</a>';
echo '</h2>';
echo '<h6>'; the_excerpt(); '</h6>';
}
if ((is_home())) {
echo '<h2 class="entry-title"><a href="'; echo the_permalink(); echo'" title="'; the_title(); echo '">'; the_title();
echo '</a>';
echo '</h2>';
echo '<h6>'; the_excerpt(); '</h6>';
echo '<h4>';
echo '<a href="'; echo the_permalink(); echo '">';
echo '<img src="'; bloginfo( 'template_directory' ); echo '/images/read_more.gif" alt="Read more..." border="0" />';
echo '</a>';
echo '</h4>';
echo '<hr />';
}
?>
<?php ?>
</div>
<div class="body-bottom"></div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<?php get_footer(); ?>
對於分頁,您可以使用插件名稱WP-PageNavi插件。 插件網址:-http: //wordpress.org/extend/plugins/wp-pagenavi/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.