我试图根据他们写入查询的顺序对查询进行排序,但它需要按ID排序。
可变的$idpaginas打印:20659206262058520618464197481999118520205882126818753205621277188291855121132
但查询后,它会打印:1852018520185511875318829。。。。。
function LoopMode($atts, $output = null, $my_query = null, $query_args = null) {
// Params extraction
extract(shortcode_atts(array(
\'idpaginas\' => \'\',
\'style\' => \'\',
), $atts));
$query_args = array(
\'post_status\' => \'publish\',
\'post__in\' => explode( ",", $idpaginas ),
\'posts_per_page\' => -1,
\'post_type\' => \'page\',
\'order_by\' => \'post__in\',
\'order\' => \'ASC\',
);
if(empty($style)){ $style = \'2\'; }
// Run query
$my_query = new WP_Query( $query_args );
//$output = \'\';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="cluster-box col-<?php echo $style; ?>">
<a href="<?php the_permalink() ?>" class="cluster-mcl-link">
<div class="mcl-cluster">
<div class="mcl-cluster-img" style="background-image:url(<?php the_post_thumbnail_url(); ?>);">
<div class="mcl-cluster-title"><h3><?php the_title(); ?></h3></div>
</div>
</div>
</a>
</div>
<?php endwhile;
$my_query = null; $my_query = $temp;
$output = ob_get_contents();
ob_end_clean();
wp_reset_postdata();
return $output;
}
add_shortcode(\'cluster\', \'LoopMode\');
我已尝试删除args“;“订购人”;和;订单“;价值观,但它仍然按照他的意愿继续订购。
谢谢