is_category() – WordPress*リファレンス

カテゴリーアーカイブページを表示している時。

原文(翻訳元)
When any Category archive page is being displayed.

is_category(‘9′)

カテゴリー9のアーカイブページの時、表示します。

原文(翻訳元)When the archive page for Category 9 is being displayed.

is_category(‘Stinky Cheeses’)

“Stinky Cheeses”というカテゴリー名のアーカイブページの時、表示します。

原文(翻訳元)
When the archive page for the Category with Name “Stinky Cheeses” is being displayed.

is_category(‘blue-cheese’)

カテゴリースラッグ名”blue-cheese” のカテゴリーのアーカイブページの時、表示します。

原文(翻訳元)When the archive page for the Category with Category Slug “blue-cheese” is being displayed.

is_category(array(9,’blue-cheese’,'Stinky Cheeses’))

表示されるポストのカテゴリがterm_ID 9、”blue-cheese”スラッグ、または”Stinky Cheeses”名前のどちらかであるときに、本当に戻ります。

原文(翻訳元)Returns true when the category of posts being displayed is either term_ID 9, or slug “blue-cheese”, or name “Stinky Cheeses”. Note: the array ability was added at Version 2.5.

in_category(‘5′)

本当に、指定されたcategory idにはポストが電流であるならあります。リターン、さらに読んでください。注意: テスト、”is”、およびin”が大差であるときに、スペルを必ずチェックしてください。また、is_archive()とCategory Tmplatesを見てください。

原文(翻訳元)Returns true if the current post is in the specified category id. read more Note: Be sure to check your spelling when testing, “is” and “in” are a big difference. See also is_archive() and Category Templates.


HOME » テンプレートタグ » 条件タグ » is_category() – WordPress*リファレンス