Support » Everything else WordPress » How do you list a single page title?

  • Resolved Jayjerome


    I know how to echo all the page titles listed in the Page Index:

      <?php wp_list_pages(‘title_li=’ ); ?>

    but if I only want to show a specific page and its subpages, is there a ?php code to do that?

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you don’t have lots of pages, you could just add an exclude argument and block all pages from being shown except the one you want. An example is here.


    Thanks for the suggestion, but I think it’s going to be cumbersome to use the ‘exclude statement.’

    First, I have to create a custom page template for each ‘special’ page I want to display and add the exclude statement to it. And then go and create the page in the administration section.

    Although I’m planning on about a dozen ‘special’ pages, if I only had to write the exclude statement one time for each new template, that’s manageable.

    But once I set up those pages, each time I create new pages won’t I have to go back to each template and update the ‘exclude statement’again?

    That may be too high-maintenance. What I’d really like to find is code I can add to the default page.php file that says something like: “when a page is displayed, only show it’s title and sub-pages, ignore all others.”

    Is that feasible?

    I believe this thread covers what you’re looking to do:

    Kafkaesqui: that’s exactly what I needed. Thanks so much for the brilliant code!!!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do you list a single page title?’ is closed to new replies.