你好我想按发布日期+元键排序排名靠前的结果,这样它只显示最新发布的内容+完整评分/分数
这是我的密码
<div class="featbox">
<h3 class="sidetitl "> Top Rated Movies </h3>
<?php
$rate_query = new WP_Query( array ( \'post_type\' => \'movies\', \'orderby\' => \'date\', \'meta_value\', \'meta_key\' => \'wtf_rscore\', \'posts_per_page\'=>\'14\' ) );
while ( $rate_query->have_posts() ) : $rate_query->the_post();
?>
请帮帮我,谢谢:)
SO网友:TheDeadMedic
您的语法已关闭-我可以看到您正在尝试添加meta_value
作为orderby
param,但实际上您已经添加了一个数组条目-这就是为什么格式化和缩进很重要!
$rate_query = new WP_Query([
\'post_type\' => \'movies\',
\'orderby\' => \'date meta_value_num\',
\'meta_key\' => \'wtf_rscore\',
\'posts_per_page\' => 14,
]);