Skip to content Skip to sidebar Skip to footer

WordPress get child pages of the current page

Reading Time: < 1 minute

How to get a list of child pages of the current page in the WordPress.Only you have to call to wordpress wp_list_pages core function to get child pages.No display errors and no need to write sql statements.

	
$currentPageID = $post-&gt;ID; //current page ID 
$children = wp_list_pages('title_li=&amp;child_of='.$currentPageID.'&amp;echo=0'); 

 

Note:
Get parent page ID

	  
$post->post_parent;

Get Current page ID

	  
$post->ID;