I have some code that displays the headings and post thumbnails of a pages' children and grand children.
I'd like to edit it so that the first child is a h2, and then wrap a div around each next child.
Is this possible?
<?php
$mypages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc');
foreach($mypages as $page)
{
$content = $page->post_content;
if(!$content) // Check for empty page
continue;
$content = apply_filters('the_content', $content);
?>
<h2><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h2>
<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
<?php
}
?>