Site icon

Create a list of pages in a parent category

In Create a list of pages in a specific category, I showed how I created index pages for my WordPress site. It works great except with two categories. These two categories are parent categories and the code includes the child categories too. Because the number of pages in each category is high, this is not workable.

I found more code samples that used an array to limit the posts to the parent category but I still needed to sort and control the number of posts per page. This code works great:

array(108),'posts_per_page'=>100,'order'=>asc, 'orderby'=>title));?>
Exit mobile version