ホーム > Yet Another Photoblog > 最新記事を除いた最近の記事を表示

最新記事を除いた最近の記事を表示

トップページに最新の記事1件とその下に最近の記事のタイトル5件並ぶようにしたい

 とのことで、プラグイン使わずに解決する方法をご紹介。

 query_posts を使って offset=1 のパラメータを入れると良いかと思います。

<?php
query_posts($query_string . "&category_name=blog&showposts=5&offset=1");
if (have_posts()) :
?>
  <div id="recent_entries" class="post">
    <h3 class="title">Recent Entries</h3>
    <ul>
<?php
  while (have_posts()) : the_post();
?>
      <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php  endwhile; ?>
    </ul>
  </div>
<?php endif; ?>
<?php query_posts($query_string . ""); //初期化 ?>

※参考:「スゴク便利な万能タグ「query_posts」ただし… | WordPressカスタマイズメモ【企業ホームページ制作方法】

※この記事は以下の記事に修正を加え再録したものです。下記のURLからアクセスした場合はこちらにリダイレクトするように設定しています。
[Title] 最新記事を除いた最近の記事を表示 « Blog « LOVING CAT
[URL] http://lovingcat.net/2007/10/07/display-recent5entry-minus-latest/

コメント:0

コメントフォーム
入力した情報を記憶する

トラックバック:0

この記事のトラックバック URL
http://web.lovingcat.net/display-recent-entry-offset1/trackback/
トラックバックの送信元リスト
最新記事を除いた最近の記事を表示 - LC Memo より

ホーム > Yet Another Photoblog > 最新記事を除いた最近の記事を表示

検索
フィード
メタ情報

Return to page top