WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] It Works But WHY? (3 posts)

  1. thisisedie
    Member
    Posted 1 year ago #

    Through trial and error I figured out how to do something but I'm curious as to WHY it worked. I have a page query in which I've excluded 2 pages. I wanted to exclude the children of one of those pages as well but nothing worked until I added 'post_parent' => 0. It works perfectly but I'd like to know why (in case it's the wrong way to go about it) and I can't find anything that explains. Anyone?

    NOTE: After a bit more playing it appears it excludes any page that is a child?

  2. vtxyzzy
    Member
    Posted 1 year ago #

    The argument you added will select posts whose post_parent id is 0.

    In other words, select posts where no parent exists for that post. So no child page is selected because its post_parent is not zero.

  3. thisisedie
    Member
    Posted 1 year ago #

    Ah. Thank you very much.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.