开发者

How to display child posts of a given post with pagination?

I am newbie for wordpress. Can anyone help me to display a list of posts under given parent post. I need to manage pagination for those child posts. I have used this code.

 $all_pages = get_pages('child_of='.$post->ID.'&sort_column=post_title');
foreach($all_pages as $pages)
           {
                     // here goes display of the post info
                   开发者_开发知识库}

Thanks in advance.


Check out the function paginate_links(). Use it to create the pagination HTML, along with a bit of PHP logic to create the values for the limit and offset variables you can pass into get_pages().

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜