is_category()

Sponsored Link

任意のカテゴリーアーカイブページが表示されている場合です。

Sponsored Link

原文(翻訳元)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_ID9、”blue-cheese”スラッグ、”Stinky Cheeses”の名前のいずれかで表示された投稿のカテゴリーの時にtrueを返します。注:配列機能は、バージョン2.5から追加されました。

原文(翻訳元)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’)

現在の投稿が指定されたカテゴリーID内の場合、trueを返します。続きを読む。

原文(翻訳元)Returns true if the current post is in the specified category id. read more

in_category( array( 1,2,3 ) )

現在の投稿が、カテゴリー1、2、3のいずれかの中にある場合、trueを返します。

原文(翻訳元)Returns true if the current post is in either category 1, 2, or 3.

!in_category( array( 4,5,6 ) )

現在の投稿がカテゴリー4、5、6のいずれかでない場合、trueを返します。!で始まる場合は注意してください。

原文(翻訳元)Returns true if the current post is NOT in either category 4, 5, or 6. Note the ! at the beginning.

注:必ずテスト確認する時、スペルの確認をする事です。”is” と “in”は大きな違いです。

原文(翻訳元)Note: Be sure to check your spelling when testing, “is” and “in” are a big difference.

is_archive()とカテゴリーテンプレートを参照してください。

原文(翻訳元)See also is_archive() and Category Templates.

Sponsored Link