Archived topic
PODs CPT - Sidebar
5 replies · Started by David on November 10, 2017
Hi Tom,
If i add a sidebar to the single blog post it also appears on the CPTs created in PODs.
I notice the CPT's carry the single class as do the posts and thought maybe i could target posts with this class that didnt have the single-post class..
Any thoughts?
regards
David
Single posts will inherit the Single post sidebar layout set in the Customizer.
Are you wanting to disable the sidebar on this specific post type?
Hi Tom
Yes i have three CPTS that dont require it
thanks
David
You could do this:
add_filter( 'generate_sidebar_layout', 'tu_cpt_sidebar_layout' );
function tu_cpt_sidebar_layout( $layout ) {
if ( is_singular( 'post-type-name' ) ) {
return 'no-sidebar';
}
return $layout;
}
Thank you Tom. Much appreciated.
You're welcome :)