Amazon.co.jp ウィジェット

wp_link_pages – WordPress テンプレートタグのリファレンス

投稿にページ番号をつけるページリンクを表示します(すなわち、<!–nextpage–>のクイックタグを1つまたは複数回が含まれています)。 link_pages()と同様の機能との相違点は、引数がクエリー文字列の形式で与えられていることです。このタグは、The_Loop以内にする必要があります。

原文(翻訳元)Displays page-links for paginated posts (i.e. includes the <!–nextpage–> Quicktag one or more times). This works in much the same way as link_pages(), the difference being that arguments are given in query string format. This tag must be within The_Loop.

wp_link_pagesのテンプレートタグ使用方法

<?php wp_link_pages( $args ); ?> 

デフォルトの使い方

<?php $args = array(
    'before'           => '<p>' . __('Pages:'),
    'after'            => '</p>',
    'link_before'      => ,
    'link_after'       => ,
    'next_or_number'   => 'number',
    'nextpagelink'     => __('Next page'),
    'previouspagelink' => __('Previous page'),
    'pagelink'         => '%',
    'more_file'        => ,
    'echo'             => 1 ); ?> 

wp_link_pagesのパラメーター

before

(string)テキストの前にすべてのリンクを配置する。 ページでのデフォルトは<p>:。

原文(翻訳元)(string) Text to put before all the links. Defaults to <p> Pages:.

after

(string)テキストの後にすべてのリンクを配置する。 ページでのデフォルトは</p>:。

原文(翻訳元)(string) Text to put after all the links. Defaults to </p>.

link_before

(string)テキストリンクのテキストの前に行く。デフォルトは(空白)。バージョン2.7以降が必要です。

原文(翻訳元)(string) Text that goes before the text of the link. Defaults to (blank). Version 2.7 or later required.

link_after

(string)テキストリンクのテキストの後に行く。デフォルトは(空白)。バージョン2.7以降が必要です。

原文(翻訳元)(string) Text that goes after the text of the link. Defaults to (blank). Version 2.7 or later required.

next_or_number

(string)ページ番号を使うべきかどうかを表示する。有効な値は:

原文(翻訳元)(string) Indicates whether page numbers should be used. Valid values are:

  • number (Default)
  • next (Valid in WordPress 1.5 or after)

nextpagelink

(string)次のページへのリンクテキストです。デフォルトは次のページです。(WordPress1.5またはそれ以降に有効)

原文(翻訳元)(string) Text for link to next page. Defaults to Next page. (Valid in WordPress 1.5 or after)

previouspagelink

(string)前のページへのリンクテキストです。デフォルトは前のページです。(WordPress1.5またはそれ以降に有効)

原文(翻訳元)(string) Text for link to previous page. Defaults to Previous page. (Valid in WordPress 1.5 or after)

pagelink

(string) ページ番号の文字列を指定します。文字列内の%は、ページ%が”ページ1″、”ページ2″などに生成された数に置き換えられます。デフォルトは%です。

原文(翻訳元)(string) Format string for page numbers. % in the string will be replaced with the number, so Page % would generate “Page 1″, “Page 2″, etc. Defaults to %.

more_file

(string) ページへのリンクが指している必要があります。デフォルトは現在のページ。

原文(翻訳元)(string) Page the links should point to. Defaults to the current page.

echo

(boolean) エコーまたは結果を返すかどうかを切り替えます。デフォルトはtrueです。有効値:

原文(翻訳元)(boolean) Toggles whether to echo or return the result. The default is true. Valid values:

  • 1 (True) – Default
  • 0 (False)

デフォルトの使い方

次ページと前ページを使用したり、ページ1、ページ2のようにページ番号でそれらをリストアップしてなどして、次の段落タグの前後にデフォルトでページリンクを表示します。

原文(翻訳元)Displays page-links by default with paragraph tags before and after, using Next page and Previous page, listing them with page numbers as Page 1, Page 2 and so on.

<?php wp_link_pages(); ?>

段落タグでページリンクを表示する方法

ページリンクは、段落タグに包まれて表示します。

原文(翻訳元)Displays page-links wrapped in paragraph tags.

<?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=page %'); ?>

DIVでページリンクを表示する方法

<div id=”page-links”>としてCSSリファレンスのためのDIVにページリンクを表示します。

原文(翻訳元)Displays page-links in DIV for CSS reference as <div id=”page-links”>.

<?php wp_link_pages('before=<div id="page-links">&after=</div>'); ?>

変更ログ

Since: 0.71

ソースファイル

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

原文(翻訳元)wp_link_pages() is located in wp-includes/post-template.php.

関連テンプレートタグ

the_ID, the_title, the_title_attribute, single_post_title, the_title_rss, the_content, the_content_rss, the_excerpt, the_excerpt_rss, wp_link_pages, next_post_link, next_posts_link, previous_post_link, previous_posts_link, posts_nav_link, sticky_class, the_meta

Tags:

Page 1 of 11