- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hey guys! been a while…
I’m trying to get the following line to work for WP:
The page returns with a list of all pages rather than just the child pages of pages 80, 73 and 67 – so clearly my syntax is wrong. I’ve tried various combinations of if’s and and’s but it either comes back the same or not at all. What would the correct way of doing this be?
Thanks in advance!
Éamonn
Clearly a page can only have one (direct) parent, so the syntax is invalid – you must use ‘post_parent’ => 80.
There are ways to query for a number of categories, tags or posts e.g. ‘post__in’ => array(1,5,7,89,102) will return all the posts with ids specified in the array, however there is no way to perform the same query based on the post parent.
The simplest way to achieve this would appear to be through using a filter.
Ta for that – sorry for the late response – I got bloody Swine Flu (not badly)!
Given that I’ve already used the post_parent tag (with a different, single, value) twice already elsewhere on the same site, does changing the functions.php file not affect those other instances also? All these ‘posts’ are, in fact, pages so I can’t categorise them. Otherwise the ‘post_in’ tag would have been perfect…
Thanks!
Stay away from the apple sauce then – :lol:
If you call add_filter, then query_posts then immediately
it will only affect that one query_posts call. Hope this answers your question.
Cheers,
Dave
Will do :D
Ta again! I’ll give it a go.
Thanks! This was just what i was looking for.
Thanks!
Is there a way to get paged results?