我想在“最新帖子”窗口小部件中只显示管理员发布的帖子(现在它显示所有投诉者发布的最新帖子)。我该怎么做?通过wp查询?谢谢:)
<?php // setup the query
$args=\'&posts_per_page=\'.$numreviews.\'_reviews&order=DESC&orderby=\'.$feedsort.$metakey;
$cust_loop = new WP_Query($args);
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
// if we\'re sorting by rating and this item does not have a rating, hide it
$rating = get_post_meta(get_the_ID(), "Rating", $single = true);
if(($rating && $feedsort=="meta_value") || ($feedsort!="meta_value")) {
$ratings = con_setup_rating($rating); //setup the ratings array
?>
<li>
<?php con_show_rating($ratings[0], $ratings[1], $ratings[2]); // show the stars or hearts ?>
<a class="post-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</li>
<?php } ?>
<?php endwhile;
endif;
wp_reset_query(); ?>