Title: rootboy03's Replies | WordPress.org

---

# rootboy03

  [  ](https://wordpress.org/support/users/rootboy03/)

 *   [Profile](https://wordpress.org/support/users/rootboy03/)
 *   [Topics Started](https://wordpress.org/support/users/rootboy03/topics/)
 *   [Replies Created](https://wordpress.org/support/users/rootboy03/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/rootboy03/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/rootboy03/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/rootboy03/engagements/)
 *   [Favorites](https://wordpress.org/support/users/rootboy03/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Show menu #number when page is](https://wordpress.org/support/topic/show-menu-number-when-page-is/)
 *  Thread Starter [rootboy03](https://wordpress.org/support/users/rootboy03/)
 * (@rootboy03)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/show-menu-number-when-page-is/#post-1806583)
 * **SOLVED**
 * If anyone wanna use the same code i used/editted.
 *     ```
       <?php
         $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1');
         if ($children) { ?>
         <ul>
         <?php echo $children; ?>
         </ul>
         <?php }
       else {
       $children2 = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1");
       } ?>
       <ul>
         <?php echo $children2; ?>
         </ul>
       ```
   
 * if statement: Shows the childeren of a page and if end page doesnt have childeren.
 * Else: Show it from the last parent.

Viewing 1 replies (of 1 total)