When building a WordPress plugin or theme which implements custom post types, you may want to add some content to only a specific post type. Fortunately, there’s an easy way to accomplish this even if you don’t have direct access to the theme templates or you don’t want to create an entire custom template for your post type. We’ll use is_singular() and the filter API (specifically the_content) to accomplish our goal.

function my_add_custom_content($content) {
	if ( is_singular( 'some_post_type' ) ):
		$html = 'Add this to the end of single posts of the type specified above';
		$content .= $html;
	endif;

	return $content;
}
add_filter( 'the_content', 'my_add_custom_content' );

You can also target multiple post types by passing an array to is_singular():

function my_add_custom_content($content) {
	if ( is_singular( array('some_post_type','another_post_type') ) ):
		$html = 'Add this to the end of single posts of the type specified above';
		$content .= $html;
	endif;

	return $content;
}
add_filter( 'the_content', 'my_add_custom_content' );

You can also get creative with the content that you add. It can be post meta, attached images, a form, the output of another custom function, or almost anything else you might want to implement!