WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It appears that I can only use an ID for the param post_parent whether in WP_Query or get_children

Is there a way to query for children via postnames which are more readable.

share|improve this question
up vote 3 down vote accepted

Try using the get_page_by_path() function (Codex ref).

So, something like:

$mypage = get_page_by_path( 'page-slug' );

$mypageid = ( $mypage ? $mypage->ID : '0' );

Then, the post_parent argument becomes:

'post_parent' => $mypageid

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.