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:

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.

Related Functions

is_single, is_search, is_ssl, is_main_query, get_singular_template

Top Google Results

User discussions

wpseek mobile