我想显示9篇文章,并能够插入一篇带有自定义html模板的贴子,在第4&;第5个岗位。目前,粘性贴子显示在“粘性容器”和常规贴子中。
have\\u posts()):$my\\u query->the\\u post();?>
<?php if ($count <= 9 ){ ;?>
<article>
<?php echo get_the_content(); ?>
</article>
<?php if ($count == 3) {
$sticky = get_option(\'sticky_posts\');
$args = array(
\'posts_per_page\' => 1,
\'post__in\' => $sticky,
\'ignore_sticky_posts\' => 1
);
query_posts($args);
if ( have_posts() ) : while ( have_posts() ) : the_post();
if($sticky[0]) { ?>
<article>
<h1>CUSTOM HTML</h1>
<?php echo get_the_content(); ?>
</article>
<?php
}
endwhile; else:
endif;
wp_reset_query();
}?>
<?php } $count++; ?>
<?php endwhile; ?>