Support » Fixing WordPress » It Works But WHY?

  • Resolved thisisedie


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    Ah. Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘It Works But WHY?’ is closed to new replies.