I am trying to list page descendants by their attachments/featured images and have succeeded mostly. What I can't seem to accomplish is to display the last 10 thumbnails of each page on their (great-)grandparent's page. Here's my structure:
- Child 1
- - Grandchild 1*
- - Grandchild 2*
- - Grandchild 3*
- Child 2
- - Grandchild 1
- - - Great-grandchild 1*
- - - Great-grandchild 2*
- - - Great-grandchild 3*
- - Grandchild 2
- - Grandchild 3
- - etc
* Only these pages have thumbnails/featured images.
And this is how it should look like:
[GC] [GC] [GC]
Child 2 title
[GGC] [GGC] [GGC]
With [GC] and [GGC] being the grandchild and great-grandchild thumbnails.
So I want to list the thumbnails of each child's (grand)children pages when I'm on the main page. I know it sort of can be done with
get_pages, but the problem is that it shows ALL the thumbnails of the descendants and I just want to show the last 10.
get_children has the
numberposts parameter which works, but it only shows the grandchildren and not the great-grandchildren thumbnails. Is there any way to accomplish this? Unfortunately
number parameter doesn't work at all.