首页 WordPress函数大全 is_singular()

is_singular()

2020-05-02 / 5224阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

is_singular( string|string[] $post_types = '' )

确定查询是否针对任何帖子类型(帖子,附件,页面,自定义帖子类型)的现有单个帖子。

描述

如果指定了$ post_types参数,此函数将另外检查查询是否针对主题开发人员手册中的>条件标签文章。

See also See also

  • is_page()
  • is_single()

Top ↑

参数

$post_types

(string|string[])
(Optional)
Post type or array of post types to check against.

Default value: ''

返回

(bool) Whether the query is for an existing single post or any of the given post types.

大家谈论
    我的见解