我正在使用从Wordpress codex:
<?php // Displaying Child pages of the current page in post format
$mypages = get_pages(\'child_of=\'.$post->ID.\'&sort_column=post_date&sort_order=desc\');
$count = 0;
foreach($mypages as $page)
{
$content = $page->post_content;
if(!$content)
continue;
if($count >= 20)
break;
$count++;
$content = apply_filters(\'the_content\', $content);
?>
<div class="content-block">
<h2><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h2>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( \'Permalink to %s\', \'twentyten\' ), the_title_attribute( \'echo=0\' ) ); ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a>
<?php echo $content ?>
</div>
<?php
}
?>
我尝试了以下代码来获取页面的特征图像:
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( \'Permalink to %s\', \'twentyten\' ), the_title_attribute( \'echo=0\' ) ); ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a>
还有这个:
$thumbnail = apply_filters(\'the_post_thumbnail\', $thumbnail);
但它没有得到应有的图像。
有什么建议吗?