我想在wordpress主题中显示页面项目,代码如下:
<section id="two">
<div class="inner">
<?php
$pagesargs = array(
\'posts_per_page\'=> 2,
\'offset\'=> 0,
\'category\' => \'\',
\'category_name\' => \'\',
\'orderby\' => \'post_date\' ,
\'order\' => \'DESC\',
\'include\' => \'\',
\'exclude\' => \'\',
\'meta_key\' => \'\',
\'meta_value\' => \'\',
\'post_type\' => \'page\',
\'post_mime_type\' => \'\',
\'post_parent\' => \'\',
\'post_status\' => \'publish\',
\'suppress_filters\' => true,
);
$my_pages = get_pages($pagesargs);
foreach ($my_pages as $page){
?>
<article>
<div class="content">
<header>
<h3><?php the_title() ?></h3>
</header>
<div class="image fit">
<img src="<?php bloginfo(\'template_url\')?>/style/images/pic01.jpg" alt="" />
</div>
<p><?php the_excerpt(); ?></p>
</div>
</article>
<?php } ?>
</div>
</section>
但在索引中只显示帖子!!如何更改并显示帖子?