wordpress是一个强大的内容管理系统,在其基础上稍加修改就可以实现很多常见的web应用。调用分类目录下文章列表是站点开发最常用的模块,因为最近准备写个wordpressCMS所以gg了些资料,先上个wordpress调用分类目录文章列表的代码。接下来的几篇文章将会分析所涉及的函数…
<?php  $i='x';$posts = get_posts( "category=1&numberposts=3" ); ?>
<?php if( $posts ) : ?>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_title(); ?></a>
<?php endforeach; ?>
<?php endif; ?>

Comments are closed.

博百优

博百优