is_singular


is_singular ( $post_types = '' )

Parameters:
  • (string|array) $post_types Optional. Post type or array of post types. Default empty.
See:
Returns:
  • (bool) Whether the query is for an existing single post of 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 https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.

Related Functions

is_single, is_search, is_ssl, is_main_query, is_year

Top Google Results

User discussions

wpseek mobile