Set templates for custom post types

If your theme and plugins follow the basic WP template hierarchy and different content types actually have their own custom post types, you should be able to achieve this through template naming. Learn more from http://codex.wordpress.org/Post_Type_Templates and http://codex.wordpress.org/Template_Hierarchy

Unfortunately many plugins (and some themes too) have their own template structure and this might cause problems.

If you can’t use template naming, you can check the current post type inside the main template and output sidebar and other stuff through if-else statements (see example below).

if ( get_post_type() == 'yourposttypewithsidebar' )
{
    get_sidebar();
}
else
{
    // don't show sidebar
}