wordpress - 我可以使用 get_posts() 从 WP-PostRatings 和 WP-PostVevs 插件获取页面吗?
问题描述
我使用 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(); ?>
但仅用于评分和观看次数
解决方案
推荐阅读
- java - 如何制作归并排序算法?
- angular - 如何将离子 http GET 请求从 @angular\Http 转换为 @ion-native\Http?
- java - 从文件创建的数组,程序挂在使用它的任何方法上
- vb.net - 将参数传递给水晶报表
- javascript - Sequelize:如何防止包含关系的虚拟列出现在查询结果中?
- selenium - 在尝试通过 getPagesource 从 Selenium 解析 PageSource 时,元素类型“link”必须由匹配的结束标记“”终止
- reactjs - React v4 和 Redux:API 调用后更新 URL 以显示新路由?
- javascript - ES6通过数组中的对象属性求和
- elasticsearch - elasticsearch date_histogram offset 和 extended_bounds 不能一起工作?
- django - 在 Django-Organizations 中按组织过滤组织用户