飞龙博客

飞龙博客 飞龙在天

如何调用wordpress指定类别下的文章列表

feilong.org 修订于2006-07-27 09:49:30 387 次浏览

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

新作:

旧文:

blog money bui 教程 echarts 教程 eclipse 教程 html css 教程 IT趋势 js 教程 json 教程 mysql 教程 nodejs npm 教程 onblog SQLite 教程 tutorials vscode 教程 wap网站 winpe启动盘 wordpress 主机推荐 书法 前端开发 博客 名企名网 国学 域名注册 常用软件 建站程序 操作系统 教程 数码 无线上网 日记 电子商务 电脑笔记本 网站 网站优化 网站开发 网站推广 网站策划 网络 虚拟现实 默认