WordPress.org

Forums

query_posts post_parent Want Page Descendants (4 posts)

  1. mikedev
    Member
    Posted 2 years ago #

    I'm trying to use query_posts to list all descendants of a page ID. Using post_parent only lists the first-level children.

    This Trac ticket seems to address it: http://core.trac.wordpress.org/ticket/5742, but I don't understand it -- post_parent only lists the first-level children.

    Here's my code: http://pastebin.com/b6aw9qMN

    How do I get query_posts to list all descendants of a page ID?

  2. as you pastebin is gone, just a guess:

    http://codex.wordpress.org/Function_Reference/get_pages

    try to use the 'child_of' parameter - should work in a query as well.

  3. mikedev
    Member
    Posted 2 years ago #

    alchymyth,

    Don't know why my pastebin disappeared. Here it is again: http://pastebin.com/KmN2N1nX

    The child_of parameter doesn't seem to work. It shows all descendants, not filtered by taxonomy or term.

    Any ideas?

    Thank you!

  4. without seeing the pastebin code, it was not clear that you were inluding a taxonomy filter - ignore my reply.

Topic Closed

This topic has been closed to new replies.

About this Topic