Hey folks,
I'm trying to set up a template with 4 content areas.
In the admin, I've set this up as a page, with three children.
I'm using the following code, but I think that there's something wrong with my loop:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); //display the parent content ?>
<hr />
<?php $thispage=$post->ID; ?>
<?php $childpages = query_posts('showposts=3orderby=menu_order&order=asc&post_type=page&post_parent='.$thispage);
if($childpages){ // display the children content
$i=1;
foreach($childpages as $post) :
setup_postdata($post); ?>
<h2><?php the_title(); ?></h2>
<?php the_content();?>
<hr />
<?php
$i++;
endforeach;
} ?>
<?php endwhile; endif; ?>
When I use the above code, I get the parent content followed by the hr, then the children also with hr, but then an extra content piece.
Here's what the page looks like right now - http://www.ralphsultanmla.ca/wp/ralphs-newsletter-for-july-2010/
Anyone know how I can fix this loop, so that the last piece of content doesn't appear?