据我所知,你的问题是,你想从特定类别获得帖子。
<div class="callbacks_container">
<ul class="rslides" id="slider3">
<?php
$the_query = new WP_Query(array(\'order\' =>\'descending\',\'orderby\' =>\'ID\',\'posts_per_page\' =>\'5\', \'category_name\' => \'news\'));
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<li>
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail(\'large\');
}
else {
echo \'<img alt="No Image" src="\' . get_stylesheet_directory_uri() . \'/images/no-image.png" />\';
}
?>
<p class="caption">
<?php the_title(); ?>
</p>
</li>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</ul>
</div>
添加
category_name 到$the\\u query数组,并给出类别slug的值。
像这样:
\'category_name\' => \'news\'