Display Child Pages (title & content) on Parent Page
-
Alright, I have found a couple websites (and topics) that tackle similar situations, but none of them have worked out for what I’m trying to accomplish.
I am using WordPress as a CMS and I have an About page that needs several sub pages. I’ve used the CSS to make each subpage have it’s own <div> that is floated to make columns. The result is three columns of content with the title (as a permalink) and the content (or “excerpt” using “more” in the editor).
I was able to accomplish what I need using posts and categories using the following code:
<?php query_posts('order=asc&cat=3&showposts='.get_option('posts_per_page')); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="secondary-section"> <h2><a href="<?php the_permalink(); ?>" title="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_content('(Read more …)'); ?> </div> <?php endwhile; else: ?> <?php endif; ?>
What I need is to accomplish the same effect, except the posts are child pages and the category is the parent page.
Please notice that I have the posts listed from the first published with the newest on the bottom. I’d like to do the same with pages.
- The topic ‘Display Child Pages (title & content) on Parent Page’ is closed to new replies.