如何从自定义类别页面上的特定类别获取帖子?
下面的代码获取所有类别的帖子,但我找不到根据特定类别进行筛选的方法。有人能告诉我按特定类别过滤的正确方向吗。
<?php // Display blog posts on any page @ http://m0n.co/l
$temp = $wp_query; $wp_query= null;
$wp_query = new WP_Query(); $wp_query->query(\'showposts=2\' . \'&paged=\'.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<div class="col-md-6 col-post-blog wow fadeInUp">
<div class="post-blog">
<?php the_post_thumbnail(\'large\'); ?>
<h3><a href="<?php the_permalink(); ?>" title="Read more"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<p><span class="fa fa-clock-o"></span> <?php the_time(\'F j, Y\') ?></p>
</div><!--col-md-6-->
</div><!--post-blog-->
<?php endwhile; ?>
<?php if ($paged > 1) { ?>
<ul class="pagination pagination-lg">
<li><?php next_posts_link(\'« Previous Posts\'); ?></li>
<li><?php previous_posts_link(\'Newer Posts »\'); ?></li>
</ul>
<?php } else { ?>
<ul class="pagination pagination-lg">
<li><?php next_posts_link(\'« Previous Posts\'); ?></li>
<li class="disabled"><a>Newer Posts »</a></li>
</ul>
<?php } ?>
<?php wp_reset_postdata(); ?>