所以现在,每个迭代看起来都一样,我已经有一段时间没有处理php了,你能帮我吗?
<?php
$pages = get_pages(\'child_of=\'.$post->ID.\'&sort_column=post_date&sort_order=desc\');
$count = 0;
foreach($pages as $page)
{
$content = $page->post_content;
if(!$content)
continue;
if($count >= 2)
break;
$count++;
$content = apply_filters(\'the_content\', $content);
?>
<div id="<?php echo $page->post_title ?>">
<h2><?php echo $page->post_title ?></h2>
<?php echo $content ?>
</div>
<?php
}
?>
我到处看看,发现我可以用这样的东西<?php foreach ($pages as $page) : start_wp(); ?>
<?php if ($i == 1) : ?>
//first iteration
<?php else : ?>
//the rest