deurtje
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Grandchildren aren't shown by get_pages when using meta tagsLike a charm! Thank you so much for your trouble.
Forum: Fixing WordPress
In reply to: Grandchildren aren't shown by get_pages when using meta tagsNo no, only grandchildren actually.
Forum: Fixing WordPress
In reply to: Grandchildren aren't shown by get_pages when using meta tagsUnfortunately, your code does exactly the same as mine, only showing children and not grandchildren (thus in my case showing nothing).
A workaround could perhaps be to duplicate the code and put in all the child pages their IDs instead of the parent ID, but I’d rather avoid this ofcourse.
Forum: Fixing WordPress
In reply to: Grandchildren aren't shown by get_pages when using meta tagsYes, that’s exactly why. But those ‘year’ pages/page children are also the problem, causing the grandchildren to not show up. I hope it’s a much clearer to you now, appreciate your efforts!
Forum: Fixing WordPress
In reply to: Grandchildren aren't shown by get_pages when using meta tagsWell, because they can be used multiple times. Let’s say Michael Jackson has 5 albums, each album would have the meta value ‘michael-jackson’. The artist page for Michael Jackson should list all 5 of these.
The albums are categorized in years via their parent pages, i.e. 2011, 2010, 2009, etc.
So I have a main album page which lists every album from every year. Then I have ‘child’ album pages where only albums from that year are listed. And then I have artist pages which should list every album from every year from that artist.
Forum: Fixing WordPress
In reply to: Grandchildren aren't shown by get_pages when using meta tagsThank you both for your replies. Taking your example of The Killers:
The slug of that page would be ‘the-killers’. I use this exact slug on every album page as a custom field ‘artist’. So an album page ‘Hot Fuss’ would have a meta key ‘artist’ and a meta value ‘the-killers’.
When I have an album from, let’s say Michael Jackson, I’d put ‘michael-jackson’ as a meta value.
I’m trying to separate album and artist pages from news items for which I use WordPress Posts.
And it actually works when I change the ‘child_of’ ID to the ID of a child page instead of the parent page (for instance, ‘child_of’ => 6414). And it also works when leave out the parts with meta_key and meta_value on the get_pages line. So showing children with meta values isn’t the problem, it’s showing grandchildren with meta values.
I hope I made it a bit more clear to you. I appreciate the help though!