is_singular
is_singular ( $post_types = '' )
Parameters:- (string|string[]) post_types Optional. Post type or array of post types to check against. Default empty.
See:Returns:- (bool) Whether the query is for an existing single post or any of the given post types.
Defined at: - Introduced in WordPress: 1.5.0
- Deprecated in WordPress: —
Description
Determines whether the query is for an existing single post of any post type
(post, attachment, page, custom post types).If the $post_types parameter is specified, this function will additionally
check if the query is for one of the Posts Types specified.
For more information on this and similar theme functions, check out
the {@link Conditional Tags} article in the Theme Developer Handbook.