Forums

Exclude children from a PARTICULAR parent? (6 posts)

  1. bryan868
    Member
    Posted 8 months ago #

    When using wp_list_pages, is there anyway to exclude children pages from only a PARTICULAR parent?

    I know to exclude all children I can do: &depth=1
    And I COULD exclude these children one by one using ID's.

    Just wondering if there's another way.

  2. MichaelH
    moderator
    Posted 8 months ago #

    There's exclude_tree (Note: exclude_tree argument seems to be broken if excluding more than ONE tree--see https://core.trac.wordpress.org/ticket/9153 for a fix.)

  3. bryan868
    Member
    Posted 8 months ago #

    Aw man, how did I overlook that in the Codex?!

    Thanks Michael!

  4. bryan868
    Member
    Posted 8 months ago #

    Actually I realized this doesn't work for my purposes.

    exclude_tree also excludes the parent. I just want to exclude the parent's children.

  5. bryan868
    Member
    Posted 8 months ago #

    I need something like.... exclude_child_of

  6. korythewebguy
    Member
    Posted 3 months ago #

    I'm submitting this to the "Ideas" section if it's not already there - Useful as exclude_tree is, it would be nice to also have an exclude_children argument for wp_list_pages that excluded ONLY the children and not the parent as well.

Reply

You must log in to post.

About this Topic