如何调用wordpress指定类别下的文章列表
feilong.org 修订于2006-07-27 09:49:30 369 次浏览wordpress如何调用指定类别的文章列表,而且是显示10条?这个常常用来定做cms形式的wordpress主题。本日志更新网址:http://feilong.org/defined-category-posts-list 飞龙第4次修订于20100327
某类别下文章列表10条代码如下。
<?php $posts = get_posts( "category=1400&numberposts=10" ); ?>
<?php if( $posts ) : ?>
<ul><?php foreach( $posts post ) : setup_postdata( $post ); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
更新网址:https://feilong.org/defined-category-posts-list
最初发布:20060727 09:49:30 feilong.org 于广州
加入收藏夹,查看更方便。
所在分类: wordpress