新着記事一覧を条件付きで表示したい
-
新着記事一覧を表示しているのですが、「最新記事から5つ目以降」という条件指定で表示したいと考えております。
最新記事から4つ目まではスライダーで表示するため、最新から5つ目移行を抽出したいです。
現在、ループは以下のように入力しています。
<div id="content_box"> <?php if (have_posts()) : $j = 0; while (have_posts()) : the_post(); ?> <div class="post excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"> <header> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="featured-thumbnail"> <?php if ( has_post_thumbnail() ) { ?> <?php echo '<div class="featured-thumbnail">'; the_post_thumbnail('homepage',array('title' => '')); echo '</div>'; ?> <?php } else { ?> <div class="featured-thumbnail"> <img width="200" height="110" src="<?php echo get_template_directory_uri(); ?>/images/nothumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>"> </div> <?php } ?> </a> <span><?php the_category(', ');?></span> <h2 class="title"><!-- 一覧のタイトル表示--> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?></a> </h2> </header><!--.header--> </div><!--.post excerpt-->
the_post(); のなかに必要な条件を指定すれば上手くいくでしょうか?
おわかりの方がいましたら、ご教示いただけると幸いです。
3件の返信を表示中 - 1 - 3件目 (全3件中)
3件の返信を表示中 - 1 - 3件目 (全3件中)
- トピック「新着記事一覧を条件付きで表示したい」には新たに返信することはできません。