WordPress调用指定分类下的文章

直接上代码:

 1,   // 分类ID
		        'posts_per_page' => 10, // 显示篇数
		    );
		    query_posts($args);
		    if(have_posts()) : while (have_posts()) : the_post();
			?>
		    

News, Products • 31st Sep, 09 • 1 Comment

 
 
$args:是要显示的分类的参数。

query_posts():可以用来控制在循坏(Loop)中显示哪些文章。

下面的添加循环和条件判断,还有标题,内容的输出  大家应该知道了。

你可能感兴趣的:(Wordpress)