Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    get_posts uses WP_Query but does not apply query filters by default. If you are getting different results from each, you have a query filter which is not correctly targeted. Commented May 11, 2017 at 15:42
  • I do not have any filters (maybe in plugins), but you told me what I want. Commented May 15, 2017 at 9:07
  • 1
    I have this identical issue and it occurs on a vanilla 4.9.8 too. Tested with two categories, it occurred 100% of the times if the categories are on different branches or if a child is supplied before its parent in the array. The result was as expected only when I supplied the array as (<parent>,<child>). There is clearly some kind of bug. Commented Oct 31, 2018 at 14:57