当サイト、Codex 日本語版は今後積極的な更新は行わない予定です。後継となる新ユーザーマニュアルは、https://ja.wordpress.org/support/ にあります。
万が一、当サイトで重大な問題を発見した際などは、フォーラムや WordSlack #docs チャンネルでお知らせください。</p>
万が一、当サイトで重大な問題を発見した際などは、フォーラムや WordSlack #docs チャンネルでお知らせください。</p>
関数リファレンス/get the author posts
提供: WordPress Codex 日本語版
< 関数リファレンス
現在の投稿の作成者が公開した投稿の総数を取得します。下書きと非公開の投稿はカウントしません。このテンプレートタグはループの中で使わなければなりません。
取得する代わりに表示するには the_author_posts() を使ってください。
使い方
<?php echo get_the_author_posts(); ?>
パラメータ
このテンプレートタグにパラメータはありません。
戻り値
- (整数)
- 現在の投稿の作成者が公開した投稿の総数
用例
現在の投稿について、作成者の名前と投稿数を表示します。
<p><?php the_author(); ?> は <?php echo number_format_i18n( get_the_author_posts() ); ?> 本、投稿しました。</p>
Harriett Smith は 4,250 本、投稿しました。
変更履歴
- 1.5.0 : 新規導入。
ソースファイル
get_the_author_posts() は wp-includes/author-template.php
にあります。
関連資料
作成者タグ: the_author(), get_the_author(), the_author_link(), get_the_author_link(), the_author_meta(), get_the_author_meta(), the_author_posts(), get_the_author_posts(), the_author_posts_link(), get_author_posts_url(), get_the_modified_author(), the_modified_author(), wp_dropdown_users(), wp_list_authors()
関数リファレンス、テンプレートタグ目次もご覧ください。
最新英語版: WordPress Codex » Function_Reference/get_the_author_posts (最新版との差分)