开发者

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

开发者 https://www.devze.com 2022-12-31 07:02 出处:网络
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.

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

精彩评论

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