• If I wanted every single page to include a list of subpages for that page alone, where would I find that code? I’ve been looking all over the place.

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • In a Page Template (I ripped wp-content/themes/default/page.php) with a loop showing the parent page content:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    /*
    Template Name: ChildPages
    */
    ?>
    
    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    <?php
    
    ?>
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;
    '); ?>
    
    				<?php wp_link_pages(array('before' => '<strong>Pages:</strong> ', 'after' => '
    ', 'next_or_number' => 'number')); ?>
    			</div>
    		</div>
    <?php
    $wlp=wp_list_pages('echo=0&child_of=' . $post->ID . '&title_li=');
    if ( !empty( $wlp ) ) {
    echo $wlp;
    }
    ?>
    		<?php endwhile;  ?>
    
    <?php		endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘How to generate a list of subpages ON a Page?’ is closed to new replies.