<?php $args = array( 'post_type' => 'post', 'showposts' => 3, 'orderby' => 'rand', 'post__in' => get_option('sticky_posts'),//获取置顶文章 'cat' => array(8),//指定分类id);?><?php $catquery = new WP_Query($args); while($catquery->have_posts()) : $catquery->the_post();?><li class="rowNewsLi"><h4><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4></li><?php the_content(); ?><?php endwhile; ?>
转载请注明:Wordpress» wordpress调用指定分类置顶文章
标签: