Reply To: Different layouts for different custom post types

Home Forums Support Different layouts for different custom post types Reply To: Different layouts for different custom post types

#210610
Tom
Lead Developer
Lead Developer

Hi there,

You can use our sidebar filter:

add_filter( 'generate_sidebar_layout','generate_custom_sidebar_layout' );
function generate_custom_sidebar_layout( $layout )
{
 	if ( is_post_type_archive( 'downloads' ) )
 	 	return 'right-sidebar';

 	if ( is_post_type_archive( 'notes' ) )
 	 	return 'left-sidebar';

 	// Or else, set the regular layout
 	return $layout;

 }

Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/