判断是否为ID9的分类页.
is_category(‘Stinky Cheeses’)
判断是否名称为 “Stinky Cheeses”的分类归档页.
is_category(‘blue-cheese’)
判断别名是否为 “blue-cheese”的分类归档页.
is_category(array(9,’blue-cheese’,’Stinky Cheeses’))
判断是否ID为 9, 或者别名为 “blue-cheese”, 或者名称为 “Stinky Cheeses”的分类归档页.
in_category(’5′)
判断当前文章的分类ID是否为5
in_category( array( 1,2,3 ) )
判断当前文章的分类ID是否为 1, 2, 或 3.
!in_category( array( 4,5,6 ) )
判断当前文章的分类ID是否不是 4, 5, 或 6 .
A Tag Page 标签归档
is_tag()
判断是否为标签页
is_tag(‘mild’)
判断是否为别名 ‘mild’ 的标签归档页.
is_tag(array(‘sharp’,’mild’,’extreme’))
判断别名是否为 “sharp”, “mild”, 或 “extreme” 的标签归档页.
has_tag()
判断当前文章是否有标签.
has_tag(‘mild’)
判断当前文章是否有标签 ‘mild’.
has_tag(array(‘sharp’,’mild’,’extreme’))
判断当前文章是否包含一个数组中的标签.
An Author Page 作者归档
is_author()
判断是否为作者归档页.
is_author(’4′)
判断是否为ID4的作者归档页.
is_author(‘Vivian’)
判断是否为昵称 “Vivian”的作者归档页.
is_author(‘john-jones’)
判断是否为昵称 “john-jones” 的作者归档页.
is_author(array(4,’john-jones’,’Vivian’))
判断是否为 ID 4, 或者昵称 “john-jones”, 或昵称 “Vivian” 的作者标签页.
A Date Page 日期归档页
is_date()
判断是否为日期归档页.
is_year()
判断是否为按年归档页.
is_month()
When a monthly archive is being displayed.
is_day()
判断是否为按天归档页.
is_time()
判断是否按小时, “分钟”, “秒”归档页.
Any Archive Page 归档页
is_archive()
是否归档页.
A Search Result Page 搜索结果页
is_search()
是否搜索页.
A 404 Not Found Page 未找到页面
is_404()
是否404页面.
A Paged Page 分页
is_paged()
判断是否有分页. 需要将 <!–nextpage–> 快速标签插入到文章中才能将文章分成多页.
An Attachment 附件
is_attachment()
判断是否为附件文档. 附件是通过编辑器上传工具上传的图片或其他文件. 附件能显示在相应的页面或模版中.
A Single Page, Single Post or Attachment 独立页面、单篇日志或附件









