is_single

Returns true when any single Post (or attachment, or custom Post Type) is being displayed. This condition returns false if you are on a page.

Returns true when the single post being displayed is either the post_name “beef-stew”, post_name “pea-soup” or post_name “chilli”.

is_single( array( 'Beef Stew', 'Pea Soup', 'Chilli' ) );

Last updated