get_previous_post

Sponsored Link

現在の投稿に隣接している、前の投稿を取得します。

Sponsored Link

Retrieve previous post that is adjacent to current post.

get_previous_postのファンクションタグ使用方法

<?php get_previous_post( $in_same_cat, $excluded_categories ) ?>

get_previous_postのパラメーター

$in_same_cat

(boolean) (optional) 同じカテゴリにする必要がある投稿かどうか。
デフォルト: false

(boolean) (optional) Whether post should be in same category.
Default: false

$excluded_categories

(string) (optional) カテゴリーIDを除外します。
デフォルト: ”

(string) (optional) Excluded categories IDs.
Default: ”

戻り値

  • 投稿オブジェクトが成功した場合。
  • グローバル$postが設定されていない場合はnullを返します。
  • 対応する投稿が存在しない場合空の文字列。
  • Post object if successful.
  • Null if global $post is not set.
  • Empty string if no corresponding post exists.

注釈

Uses: get_adjacent_post()

変更ログ

Since: 1.5.0

ソースファイル

get_previous_post()は、wp-includes/link-template.php内に位置しています。

get_previous_post() is located in wp-includes/link-template.php.

Sponsored Link