正如KevinLangleyJr.所说,您可能需要使用php逻辑来实现这一点。
您需要为查询修改此选项,但请在循环中尝试为帖子类型添加标志:
$firstOfPostType = true; //set your flag to true initially
if( have_posts() ) : while( have_posts() ) : the_post();
if( $firstOfPostType == true && $post->post_type == "YOUR POST TYPE" ){
continue;// Skip this iteration
$firstOfPostType = false;// set this to false so it doesn\'t run again.
}
[编辑:添加注释中提供的格式化代码]
这may 工作取决于内容POSTFORMAT中的内容。php是由get\\u template\\u part()引入的,您可能需要将代码放在其中。
<?php
query_posts(
array(
\'posts_per_page\' => 10,
\'paged\' => ( get_query_var(\'paged\') ? get_query_var(\'paged\') : 1 ),
)
);
$posts = get_posts(
array (
\'numberposts\' => \'10\',
\'post_type\' => array (
\'post\',
\'episodes\',
\'featured-stories\'
),
))
;
$firstOfPostType = true;
foreach ($posts as $post) : start_wp();
if( $firstOfPostType == true && $post->post_type == "episodes"){
$firstOfPostType = false;
continue;
}
?>
<?php
static $count2 = 0;
if ($count2 == "10") { break; }
else { ?>
<?php get_template_part( \'content\', get_post_format() ); ?>
<?php $count2++; } ?>
<?php endforeach; ?>