Wordpress get the child pages of current page

I want to display the child pages of the current page you are on.

?php wp_list_pages('child_of=67sort_column=menu_ordertitle_li=') ?

If I give the id number like above it works perfectly like this:

However I want to use this as a template for multiple pages, but when I use the ID or get Id or echoing the ID, it also take the sibling pages of the parent page. Which I don't need.

?php wp_list_pages('child_of=the_ID()sort_column=menu_ordertitle_li=') ?

I can't figure it out what I am doing wrong.

Topic get-the-id get-children child-pages Wordpress

Category Web


<?php 
$current_page_id = get_the_ID();
wp_list_pages("child_of={$current_page_id}&sort_column=menu_order&title_li="); ?>

Please check the above code

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.