Support » Fixing WordPress » List sub pages inside a page… hmmm :)

  • I would like to list the sub pages inside a page. I am using runPHP to run php inside my page… For some reason this piece of script returns “4” ?!?!

    $current_page_id = the_ID();

Viewing 3 replies - 1 through 3 (of 3 total)
  • the_ID() doesn’t return the ID for use in PHP, it inserts it into the page, which is why it’s showing up.

    Try this:


    and if that doesn’t work and the following just before it:

    global $id;

    where do u put this code?? has it worked yet??

    i too want to show my sub pages in my parent page..

    this code works perfectly, and unlike a lot of code floating around the support forums, it also displays the submenu when you’re on child page:

    <?php if(get_the_title($post->post_parent) != the_title(' ' , ' ',false)) {
    } else {
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘List sub pages inside a page… hmmm :)’ is closed to new replies.