目前帖子在分类页面中按最后添加的排序,这是代码,请如何使其随机
if (is_category()) {
$categories = array(get_query_var(\'cat\'));
$subcats = get_categories(array(\'child_of\' => get_query_var(\'cat\')));
if ($subcats) {
foreach ($subcats as $subcat) {
array_push($categories, $subcat->cat_ID);
}
}
if (of_get_option(\'show_repins\') != \'disable\') {
$args = array(
\'category__in\' => $categories,
\'paged\' => $paged
);
} else {
$args = array(
\'category__in\' => $categories,
\'paged\' => $paged,
\'meta_query\' => array(
\'relation\' => \'OR\',
array(
\'key\' => \'_Original Post ID\',
\'compare\' => \'NOT EXISTS\'
),
array(
\'key\' => \'_Original Post ID\',
\'value\' => \'deleted\'
)
)
);
}
query_posts($args);
}