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
}
Related Posts:
- display different template based on post type
- previous_post_link() and next_post_link() with a custom post type?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Setting a custom sub-path for blog without using pages?
- Custom Post Types 404 Issue
- How to add custom content template part for a custom post type on main query using a plugin
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Loading custom page template via plugin
- How to set a fall back template for a custom post type in a plugin?
- Templates for Custom Post Types and Custom Taxonomies
- Apply template to custom post type
- Page is defaulting to archive page and not designated template
- How to quickly switch custom post type singular template?
- How to list/show all custom post types regardless of category?
- How to query custom posts using a dynamic category
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Custom Post Type with Nested Taxonomy and Template Files
- Create Pages from Database
- Custom post type loops with different page templates
- Include different loop templates in search query
- Turn query string to sub page
- WordPress Template Hierarchy
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- is_page_template not working as expected
- Multiple templates for a custom post type
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- How to show the archive / post type description on Single templates
- Set up Custom-Post-Type Author Archive
- Query with no terms uses index.php template instead of archive.php
- WordPress Custom Post Type Children Template
- Getting template_include to work when allow_url_include is off?
- Content vs Template on custom post
- WordPress Doesn’t Generate Taxonomy Archive
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- WordPress custom taxonomy template not working
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- WordPress 3.9 not using custom template
- How to Create Template File for Parent Page of Custom Post Type
- Custom post_type search pages
- how to remove pages loading with the archive templates
- Custom Empty Results page for my Custom Post Type
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- Creating Sections for Post Types
- Custom post types with categories in template
- How can I trace inconsistency in loading a template?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- assign different templates to custom post type with homepage loop
- Custom post type is using the index.php template
- Get template part with CPT and Custom Taxonomy conditionals
- Displaying a list of Contacts
- How to change single custom post template by custom taxonomy?
- Custom permalink structure for remote content pages
- Setting a homepage – doesn’t seem to work
- Custom post type draft use wrong template
- List of a specific Custom Post Type in Custom Template
- How can I add in post’s the text “No content”
- How to customize `Edit-Post` Screen
- Calling a div and content in php?
- Tag template not returning posts [closed]
- Function to allow single post template based on custom taxonomy?
- Specifying a template for custom post type pages
- Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
- Custom post type set default template using block editor
- A certain theme is forcing it’s singular post layout
- Post template not applying on theme (potentially rendering as Page template)
- Custom post type defaults to index.php for archive page
- Custom Post Taxonomy Template Not Loading Properly
- Is it possible to link an external stylesheet, exclusively within a specific single post template?
- Templating advice sub posts of a CTP
- Question on templates
- Assign for all post of a post type a specific single-post template
- Custom post type option page template
- Taxonomy template file not working with a taxonomy that contains a slash
- taxonomy – templates are not loading
- How can I load Template file from wordpress plugin
- How to override post-new.php with custom template
- How can I find out what template is my custom post type using?
- Can I organise my custom post types by page?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Loading a template for a URL pattern
- Redirect to different template other than single-custompost.php
- WordPress Custom taxonomy template
- custom post type plugin – single template
- Use one template for different custom post types with the same markup
- Custom page template not being called
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- How can I pull information from my loop and divide them seperately?
- Custom post type pagination, single page issue
- Multisite – Echo admins profile meta
- Custom template support for custom post type?
- Storing postID in session variable to query database when visitor on custom template page
- Custom Post Type Template Based on Page Slug?
- How to make a template for a specific post of a custom post type?
- WP_Query is getting the post but the_post() not rendering any Post
- Apply text based styling done for a single post in WPBakery to all posts / create a template out of it [closed]
- PHP Button Custom link [closed]
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Why isn’t page attributes dropdown not showing up in a custom post type