算了吧!下面是一个get\\u posts方法,可以添加一个小部件(或任何内容到您定义的“$counts”数字处的砖石布局中)
<div class="arrange">
<?php
$args = array(
\'posts_per_page\' => 10000,
\'offset\' => 5,
\'orderby\' => \'post_date\',
\'order\' => \'DESC\',
\'exclude\' => \'none\',
// \'post_type\' => array(\'post\', \'page\', \'video_type\', \'review_type\' ),
\'post_status\' => \'publish\',
\'suppress_filters\' => true
);
$posts = get_posts($args);
$counts = 0 ;
foreach ($posts as $post) : setup_postdata($post); $counts++;
get_sidebar(\'corner-box\');?>
<div class="box">
<a href="<?php the_permalink() ?>">
<h2><?php the_title(); echo $counts; // to see your box number ?></h2>
<?php if (has_post_thumbnail()) {the_post_thumbnail(\'masonry\');}
the_content();?>
</a>
</div><?php if($counts == 9) { get_sidebar(\'masonry\');}
endforeach; ?>
</div> <!-- end masonry -->