Techiio-author
Started by Shaleena AgarwalSep 7, 2021

Open
How can I display the all children of a child page?

2 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWES SHARE

I'm using the below to list all child pages of the current parent page. I now need to list and child of the children pages... That may be confusing..

Get current page ID > Display all direct children of that page ID > I now need to also display the current pages children's children...

So like:

  • Child page
    • Child of Child page
    • Child of Child page
  • Child page
<div class="nav-col">
<?php
global $post;
$direct_parent = $post->post_parent;
?>
<div class="side-nav">
<?php
wp_list_pages(array(
'child_of' => $direct_parent,
'title_li' => ""
));
?>
</div>
</div>

0 Replies

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance