php列表顺序加载改为随机加载
<div class="tab-list active">
<ul class="post-loop post-loop-default cols-4">
<?php
$exclude = isset($options['newest_exclude']) && is_array($options['newest_exclude']) ? $options['newest_exclude'] : array();
$arg = array(
'posts_per_page' => $per_page,
'ignore_sticky_posts' => 0,
'post_type' => 'post',
'post_status' => array( 'publish' ),
'category__not_in' => $exclude
);
$posts = new WP_Query($arg);
if( $posts->have_posts() ) { while ( $posts->have_posts() ) { $posts->the_post(); ?>
<?php get_template_part( 'templates/loop' , 'default-sticky' ); ?>
<?php } } wp_reset_postdata(); ?>
</ul>
<?php if($posts->max_num_pages>1){ ?>
<div class="load-more-wrap">
<div class="btn load-more j-load-more" data-per_page="<?php echo $per_page;?>" data-exclude="<?php echo implode(',', $exclude);?>"><?php _e('Load more posts', 'wpcom');?></div>
</div>
<?php } ?>
</div>