is_single()
显示任何单独一篇日志时,is_single()标签返回TRUE。
is_single(’17’)
显示 ID 为17的单篇日志时,该标签返回TRUE。
is_single(‘Irish Stew’)
显示标题为”Irish Stew”的单篇日志时,该标签返回TRUE。
is_single(‘beef-stew’)
显示别名为”beef-stew”的单篇日志时,该标签返回TRUE。
is_single(array(17,’beef-stew’,’Irish Stew’))
当所显示的单篇日志 ID 为17,或 post_name 为”beef-stew”,或 post_title 为”Irish Stew”时,is_single(array(17,’beef-stew’,’Irish Stew’))标签返回TRUE。
is_single( array( 17, 19, 1, 11 ) )
当所显示的日志为 ID = 17,ID = 19, ID = 1 或者 ID = 11 时,该标签返回TRUE。
is_single( array( ‘beef-stew’, ‘pea-soup’, ‘chili’ ) )
当显示的单篇日志的 post_name 为 “beef-stew” 、 “pea-soup” 或 “chili” 时,该标签返回 TRUE。
is_single( array( ‘Beef Stew’, ‘Pea Soup’, ‘Chili’ ) )
当显示的单篇日志的 the post_title 为 “Beef Stew” 、”Pea Soup” 或 “Chili”时,该标签返回 TRUE。
注: 该函数不区分 post ID、 post title 或 post name。如果请求的是 ID 为 17 的文章,post_name 为 17 的文章也会返回 TRUE;post title 为 17 的日志也一样返回TRUE。