Wordpress Document

Author tags

Category tags

Comment tags

Date and Time tags

General tags

Geo tags

Link tags

Links Manager tags

Permalink tags

Post tags

Trackback tags

WP/PHP General

previous_post

概要

1記事だけの表示、またはパーマリンクページで使用し、日付順に並べ替えた前の記事へのリンクを表示します。
next_post_link()との対になっています。

用法

<?php previous_post('format', 'link', in_same_cat, 'excluded_category'); ?>

引数

format (string)

リンクのフォーマット。'%link'を指定するとリンクのラベル(後述)になります。
(デフォルト:'&raquo; %link')

link (string)

リンクのラベル。(デフォルト:リンク先ページのタイトル '%title')

in_same_cat (boolean)

同じカテゴリーの投稿のみのリンク表示にするかの指定
TRUE
FALSE(デフォルト)

excluded_category (integer or string)

リンクに表示しないカテゴリーIDを指定します。
'and' を使用して複数を指定出来ます。
例:'1 and 5 and 15'

用例

-