投稿を先頭に固定表示すると下の記事一覧にも同じ記事が表示されてしま
-
トップページの記事一覧をカテゴリーID55の記事は除外して
おすすめ記事(この投稿を先頭に固定表示にチェックした記事)
大見出し:最新記事2件
小見出し:最新記事3〜8件
という表示にしたいので、下記のようなコードを打ちましたが、
最新記事とおすすめ記事に同一記事があると、どちらも出力されてしまいます。<div class="row"> <?php $myquery_pickup = array( 'posts_per_page' => 1, 'ignore_sticky_posts' => 1, 'post__in' => get_option('sticky_posts') ); ?> <?php query_posts($myquery_pickup); ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <?php get_template_part('content','pickup'); ?> <?php endwhile; endif; ?> </div> <div class="row"> <?php query_posts('posts_per_page=2&ignore_sticky_posts=1&cat=-55'); ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <?php get_template_part('content','main'); ?> <?php endwhile; endif; ?> </div> <div class="row"> <?php query_posts('posts_per_page=8&offset=2&ignore_sticky_posts=1&cat=-55'); ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <?php get_template_part('content','newslist'); ?> <?php endwhile; endif; ?> </div>
どなたかご教授いただけないでしょうか。
設定などに問題があるのでしょうか。
7件の返信を表示中 - 1 - 7件目 (全7件中)
7件の返信を表示中 - 1 - 7件目 (全7件中)
- トピック「投稿を先頭に固定表示すると下の記事一覧にも同じ記事が表示されてしま」には新たに返信することはできません。