Why query by specific date with variables doesn’t return same result that with harcoded integers?

I believe your problem is that you are not casting the variables over into integers. You should give this a try: $query->set(‘date_query’, array( array( ‘year’ => (int)$dies[‘year’], ‘month’ => (int)$dies[‘mon’], ‘day’ => (int)$dies[‘mday’], ), )); or if you would like, before you even set up the arguments for the query, you could do something along … Read more

Child pages not affected by orderby

post_parent should be the ID of the post parent, not the slug. Apart from that, your code should work. If not, look for any posts_* filters or pre_get_posts actions that might influence your custom query EDIT Something else I have missed, $args is already an array, so you do not need to add it another … Read more