• Hi All,

    I am pretty new to WordPress. I’ve been converting my site from another platform and it has occurred to me that there may be an easier solution than ‘manually’ for a specific task.

    The issue – I have a lot of pages that should contain nothing except a general description and a list of the sub-pages. These can be several levels deep before the pages contain the bulk of the content itself.

    So, I was going to manually add those lists of contents etc to all the pages but recent reading has made me wonder if I can’t maybe do it with a template and a loop – or some other way?

    Can anyone advise?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Backup page.php and then open up your theme’s page.php look for:
    <?php the_content(); ?>
    Below that add this code:

    <?php $sub_pages = wp_list_pages( 'sort_column=menu_order&depth=3&title_li=&echo=0&child_of=' . $id );?>
    <?php if ($sub_pages <> "" ){?>
    <p class="post-info">This section has the following topics.</p>
    <ul><?php echo $sub_pages; ?></ul>
    <?php }?>

    That way, you can add description in the “parent page” and the links to your subpages will appear below the description.

    Thread Starter kevmartin

    (@kevmartin)

    Thanks – that’s a big help. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Automatic description of sub-pages’ is closed to new replies.