Try the following:
if ( have_posts() )
{
while( have_posts() )
{
the_post();
if ( 'reviews' === get_post_type( get_the_ID() )
{
echo 'I am a post of the post type ”reviews“';
// We're done here, continue to next post
continue;
}
// Do other stuff
}
}
EDIT
In case you’re not sure if you got that post type available, use the following plugin to check (below your admin user interfaces footer) what custom post types you got available.
<?php
/** Plugin Name: »kaiser« Get custom post type objects */
function wpsedebug_post_type_obj()
{
if ( ! is_admin() )
return;
$pt = get_post_types(
array(
'public' => true
,'_builtin' => false
)
,'object'
);
return print '<pre>'.var_export( $pt, true ).'</pre>';
}
add_action( 'shutdown', 'wpsedebug_post_type_obj' );