我可以使用get_posts()从WP-PostRatings和WP-PostVevs插件获取页面吗?

时间:2018-11-28 14:34:55

标签: wordpress

我使用WP-PostRatings WP-PostViews插件,并且能够使用函数显示页面

<?php if (function_exists('get_highest_rated')): ?>
   <ul><?php get_lowest_rated(); ?></ul>
<?php endif; ?>
<?php if (function_exists('get_most_viewed')): ?>
   <ul><?php get_most_viewed(); ?></ul>
<?php endif; ?>     

但是它们显示为纯文本,我无法对其进行编辑,无法添加帖子的缩略图,并执行其他操作可能无法像使用get_posts()一样显示它们

<?php 
global $post;
$args = array(
    'post_type' => 'post',
    'orderby' => 'comment_count',
    'order'=> 'ASC'
);
$myposts = get_posts( $args );
foreach( $myposts as $post ){ setup_postdata($post);?>
  <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
  <?php } wp_reset_postdata(); ?>       

但仅用于评分和观看次数

0 个答案:

没有答案
相关问题