Core Function
View Source on Trac ↗ is_singular()
is_singular( mixed $post_types = '' ) Determines whether the query is for an existing single post of any post type
Parameters 1 required
| Name / Type | Description |
|---|---|
| mixed | (string | string[]) $post_types Optional. Post type or array of post types to check against. Default empty. Required |
Return Value
(bool)
bool Whether the query is for an existing single post
or any of the given post types.
Function Information
Since Version
1.5.0
Source File
wp-includes/query.php
Advertisement