With the parameter ‘depth’ of the “
wp_list_pages” or the “
get_pages” function, we can define how many levels do we want to retrieve. So here, I will display all the first child level of the current page.
<?php global $post;
'child_of' => $post->ID, // Only pages that are children of the current page
'depth' => 1 , // Only show one level of hierarchy
'sort_order' => 'asc'
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.