Limit get_pages or get_children showing grandchildren
-
Hello,
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:
____________________________________
Main page
– 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:
____________________________________
Child title
[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 thenumberposts
parameter which works, but it only shows the grandchildren and not the great-grandchildren thumbnails. Is there any way to accomplish this? Unfortunatelyget_page
‘snumber
parameter doesn’t work at all.
- The topic ‘Limit get_pages or get_children showing grandchildren’ is closed to new replies.