开发者

wordpress navigation issue. previous and next posts link return blank

I have the following issue with a theme I am developing:

in my index this code

<?php previous_posts_link(); ?>
<?php next_posts_link(); ?>

returns blank results...

if instead i use

<?php previous_post_link(); ?>
<?php next_post_link(); ?>

it shows the next post (a single page). Why is that you think? Any idea? I use t开发者_运维技巧he above within the loop.


On the face of it the difference is only the slightly different spelling. The actual difference is that previous_posts_link should be used outside the loop, providing a means to paginate through posts i.e. view/page/2 where page 2 can be taken into a query_posts call getting the next batch of posts.

Whereas previous_post_link/next_post_link should be used inside the loop, providing a link to previous/next post in the publish chronology.

http://codex.wordpress.org/Function_Reference/previous_posts_link

http://codex.wordpress.org/Template_Tags/previous_post_link

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜